ASP.Net 2.0 Login Control
ASP.Net 2.0 login control provides the interface as well as in-built functionality of user login. Login control uses the default sql membership provider that authenticates the username and password for a specific account. Login control interface consists of following controls:
- UserName: Username input field accepts the login user name to be entered by the member user.
- Password: Password input field accepts the secret password for the username entered in Username input field.
- Remember me checkbox: Remember me checkbox provides the functionality that keeps the user logged in if user does not logout after last login. Remember me function drops a cookie on the client’s system that keeps the user logged in until the cookie expires or user clicks logout button.
- Login button: Login button sends the username and password to the membership provider for authentication.
To provide the login functionality in your ASP.net web application just drag and drop the login control on the web form. There are some other properties or attributes of Login control that makes it more interactive. Following are the properties of Login Control that control its different behavior:
CreateUserText property displays the text for create user link in the login control.
CreateUserUrl property accepts the URL of the page having user registration form.
DestinationPageUrl property takes the URL of the page that directs the user to the destination page upon successful login.
DisplayRemeberMe property sets remember me functionality on or off.
Orientation property sets the horizontal or vertical layout of the login control interface.
RememberMeSet property, if it is true then displays remember me checkbox initially checked.
TextLayout property sets the TextOnLeft or TextOnTop for the labels used for username and password
VisibleWhenLoggedIn property hides the login control if its value is false
Note: Your Asp.Net web application must also have user sign up form so that users could use login control using their UserName and Password. [ASP.Net 2.0 Membership CreateUser Wizard Control]
Continue to next tutorial: ASP.Net 2.0 LoginName Control to learn how to display the user name of logged in user.