Asp.net login controls overview
Asp.net Login Controls Overview
The ASP.NET login controls provide login solution for ASP.NET Web applications without requiring programming or without writing code. By default, login controls integrate with ASP.NET membership and forms authentication to help automate user authentication for a Web site.
Login controls in ASP.NET : Login controls in ASP.NET
- Login
- LoginView
- PasswordRecovery
- LoginStatus
- LoginName
- CreateUserWizard
- ChangePassword
CreateUser Wizard control
This control adds the new user to the Asp.net membership system. It gathers the information of the user
- User name
- Password
- Confirmation of password
- E-mail address
- Security question
- Security answer
Properties:
ContinueDestinationPageUrl: the URL redirect to when the continue button clicked
<asp:CreateUserWizard ID=”CreateUserWizard1″ runat=”server”>
<WizardSteps>
<asp:CreateUserWizardStep runat=”server” />
<asp:CompleteWizardStep runat=”server” />
</WizardSteps>
</asp:CreateUserWizard>
Login Control
The Login control displays a user interface for user authentication. The Login control contains text boxes for the user name and password and a check box that allows users to indicate whether they want the server to store their identity using ASP.NET membership and automatically be authenticated the next time they visit the site.
Properties:
CreateUserText: The text to be shown for the create user link. When the user edit Text that text will appear as linkbutton in Login control
CreateUserUrl: The URL of the Create user page (createuser.aspx [Registrations form])
CreateUser.aspx page contain CreateUser Wizard control in Login controls.
DestinationPageUrl: The URL that the user is directed to upon successful login
(Default.aspx page)
LoginButtonText: The text to be shown for the login button
By Default Text is Log In
Users can change Log In Text to some other text
LoginButtonType: The type of the login button (user can change button types
Button control, Image control or Link control)
<asp:Login ID=”Login1″ runat=”server”>
</asp:Login>
Login Status:
This control displays whether user is in login stage or logout stage. The login link takes the user to a login page. The logout link resets the current user’s identity to be an anonymous user.
LogOutPageUrl: The URL redirected to after logging out.
LogoutPageUrl = LogIn.aspx page (it redirects to Login.aspx page)
<asp:LoginStatus ID=”LoginStatus1″ runat=”server” />
ChangePassword control:
The ChangePassword control allows users to change their password. The user must first supply the original password and then create and confirm the new password. If the original password is correct, the user password is changed to the new password. The control also includes support for sending an e-mail message about the new password.
The ChangePassword control includes two templated views that are displayed to the user. The first is the ChangePasswordTemplate, which displays the user interface used to gather the data required to change the user password. The second template is the SuccessTemplate, which defines the user interface that is displayed after a user password has been successfully changed.
ContinueDestinationPageUrl: The URL to redirect to when the continue button is clicked
CancelDestinationPageUrl: The URL to redirect to when the cancel button is clicked
SuccessPageUrl: The URL that the user is directed to after the action has succeeded.
<asp:ChangePassword ID=”ChangePassword1″ runat=”server”>
</asp:ChangePassword>
The LoginView Control
This control allows you to display different information to anonymous and logged-in users. It displays two templates, one is AnonymousTemplate and the other is LoggedInTemplate. In the templates, you can add markup and controls that display information appropriate for anonymous users and authenticated users, respectively.
The LoginView control also includes events for ViewChanging and ViewChanged, which allow you to write handlers for when the user logs in and changes status.
<asp:LoginView ID=”LoginView1″ runat=”server”>
</asp:LoginView>
The LoginName Control
This control displays a user’s login name if the user has logged in using ASP.NET membership. Alternatively, if your site uses integrated Windows authentication, the control displays the user’s Windows account name.
<asp:LoginName ID=”LoginName1″ runat=”server” />
