i

ASP.Net A Complete Guide

Login Controls

By using the login control, we can create the user interface for the authentication. For authentication, the site requires the user name and password.

The following image shows how we can add the login control.

Go to the solution explorer -> right-click -> and select the -Web Form as shown on the below page.

Add name like shown in below image:

It will show the added login page added.

In the toolbox, you can see the login control. Just drag and drop the login control on the design window, as shown below.

Below is the source code of the login control.

Properties:

  • CreateUserIconUrl: It holds the location of the image.

  • CreateUserUrl: It holds the URL for the new user page.

  • FailureText: It holds the message when the login fails

  • HelpPageText: It holds the message of the link to the login help page.

  • Password: It holds the password entered by the user

  • DisplayRememberMe: It holds the value stating whether to display the RememberMe checkbox.

Events:

  • LoggingIn: This event initiates When use submits the login information to the system.

  • LoggedIn: This event initiate when the user logs in the web site and is authenticated.

  • LoginError: This event initiate when a login error is detected.