ASP.Net 2.0 Login Control

Updated on 09 Aug 2012,
Published on 24 May 2008

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

CreateUserText property displays the text for create user link in the login control.

CreateUserUrl

CreateUserUrl property accepts the URL of the page having user registration form.

DestinationPageUrl

DestinationPageUrl property takes the URL of the page that directs the user to the destination page upon successful login.

DisplayRemeberMe

DisplayRemeberMe property sets remember me functionality on or off.

Orientation

Orientation property sets the horizontal or vertical layout of the login control interface.

RememberMeSet

RememberMeSet property, if it is true then displays remember me checkbox initially checked.

TextLayout

TextLayout property sets the TextOnLeft or TextOnTop for the labels used for username and password

VisibleWhenLoggedIn

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.

2 Responses to "ASP.Net 2.0 Login Control"
Sam
How do I validate the username and password entered in Login Control using a connection object, which opens connection to oracle database?
Ezineasp.net
Hi Sam

Please explain what you are trying to do?
Leave a Comment
* required
* required
* will not be published
* optional
* hint: http://www.example.com
  • Subscribe via Email
  • HIRE EzineASP.Net Developers