Tuesday, April 14, 2009

Easy steps to create an asp.net website

Following tricks which have help to develop an asp.net website in quick way-
1.Form Authentication:
This is a cookie based authentication system where the username and passport is stored in a text file or a database. We will be focusing on this authentication model in this tutorial.

FormsAuthentication.AuthenticateThe single login button on the webpage calls the Login_Click method when clicked. In this method, we use the FormsAuthentication.Authenticate(username,password) to get ASP.NET to check the credentials of the user. The parameters for this method is pretty straightforward and it just returns a boolean value. FormsAuthentication.RedirectFromLoginPageIf the user is providing proper credentials, then we'll use the FormsAuthentication.RedirectFromLoginPage method. The parameters of this method are a username string and a boolean value. The first parameter is a username string and it is a name of the user for cookie authentication purposes. The value you put in there will be the user name that the client is associated with. It does not need to match the username used in the FormsAuthentication.Authenticate method but it is advisable to set the cookie to the username that was used to log in. The second parameter is a boolean value and it specifies whether or not a durable cookie (one that is saved across browser sessions) should be issued.If you remember, when a user requests a page without proper authentication, they are redirected to the login page. After setting the cookie, the RedirectFromLoginPage will then send the user back to the page they came from.
2.Use Free Tempalates:
Lot of web sites provide us free tempalte for diffrent layout.We can use easily CSS,HTML for our website.
3.Use Log4Net: Log4net is an open source library that allows .NET applications to log statements to a variety of targets.
4.Use Website Starterkits:
To find out starterkit following links should be useful-