Home | HTML | Asp.Net | HTML Probe | .Net Probe
   
 www.solvingera.com 
  Contact Us |Sitemap
  

Login Controls in Asp.Net

  Skip Navigation LinksHome>Asp Home>Login Controls

Login Control’s are also called as security controls because membership services are used by these controls.

The toolbox of the asp.net in visual studio contains a group of Login Control as shown below:
login

Login Control

Login control is a Form authentication based application which is used to authenticate a user before accessing a website or a specific part of the web application. Login control displays username and password textbox with login button. This control also contains a Remember me next time checkbox. The functionality of this checkbook is to store the value of username and password into the browser’s cookies.

You can simply drag Login Control from toolbox and drop it on a webpage. Or you can write the following code snippet :

<asp:Login ID="Login1" runat="server">
</
asp:Login>

login
Some important properties of Login Control are given below:
  • CheckBoxStyle: It is used to set the Display setting of the Remember Me checkbox.

  • CreateUserIconUrl: It retrieves the link image location to create a new user.

  • CreateUserText: It specifies the link text to create a new user.

  • CreateUserUrl: It is used to set the URL of a new user registration page.

  • DestinationPageUrl: It sets the page URL which is accessed by the user after Login or Sign in.

  • DisplayRememberMe:

  • FailureAction: It sets the action that occurs when a login attempt fails.

  • FailureText: It sets the text that is displayed when a login attempt fails.

  • HelpPageIconUrl: It retrieves the link image location to open a login help page.

  • HelpPageText : It specifies the link text to go to login help page.

  • HelpPageUrl: It is used to set the URL of the login help page.

  • LoginButtonText: It specifies the text of the Login Control’s login button.

  • PasswordRecoveryText: It specifies the hyperlink’s text for the password recovery page.

  • PasswordRecoveryUrl: It specifies the URL of the password recovery page.

The LoginView Control

The LoginView control is used to display a different set of controls for anonymous and authenticated users. It shows that a user has logged on to a website as a registered user or as a visitor. This control has three templates which are used to display the appropriate information of the authenticated user.
  • AnonymousTemplate: It displayed when the user is not logged in.

  • LoggedInTemplate: It displayed when the user is logged in.

  • RoleGroups: It displayed the information of a logged in user who is a member of a specific role with defined rolegroup templates.

The PasswordRecovery Control

The password recovery control is used to recover or reset the password when a user has forgotten their password. This is used for security purpose because it does not displays the password of the user instead of it sends the system generated password or custom password as a E-mail message to the E-mail address provided by the user at the registration time. This control also uses the membership service to create or reset the password.

You can simply drag PasswordRecovery Control from toolbox and drop it on a webpage. Or you can write the following code snippet :

<asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
</
asp:PasswordRecovery>

login


This control has three views that are given below:
  • UserName: This view asked for the user name to provide a new password or auto-generated password Email for recovery.

  • Question: This view asked for the security question which is given by the user at registration time to provide a new password or auto-generated password Email for recovery.

  • Success: This view shows the text which specifies that the retrieved password has been sent to the user.
Some important properties of PasswordRecovery Control are given below:
  • MailDefinition: Sets the content and body of the E-mail messages sent to the user to recover password.

  • MembershipProvider: It is used to get the name of the Membership Service Provider.

  • QuestionTemplate : This template is used to set the look of the Question View.

  • SuccessPageUrl: Sets the URL of the page that will display when the forgotten password is sent to the user’s e-mail address successfully.

  • SuccessTemplate: This template is used to set the look of the Success View.

  • ValidatorTextStyle: This control is used to set the appearance of the validator controls used in Password Recovery Control.

The LoginStatus Control

The LoginStatus Control is a Login Control that is used to display the login status of the control. This control shows the login link if the user is not authenticated and shows the logout link if the user is authenticated (authenticated user is a registered user).
You can simply drag LoginStatus Control from toolbox and drop it on a webpage. Or you can write the following code snippet :

<asp:LoginStatus ID="LoginStatus1" runat="server" />

login


Some important properties of LoginStatus control are given below:
  • LoginText: It specifies the text if the user is not signed in.

  • LoginImageUrl: It specifies the URL for an image displayed as an icon for the login link.

  • LogoutImageUrl: It specifies the URL for an image displayed as an icon for the logout button.

  • LogoutAction: Sets the value(i.e Refresh, Redirect, and RedirectToLoginPage) of the action, when an authenticated user logs out of a website.

  • LogoutText: Displays the text as a logout link.

The ChangePassword Control

The ChangePassword control is used to change the old password and sets the new password. To change the password, first of all user has to enter their old password then set a new password and re-type the new password again in the "Confirm New Password" text box. This control also provides the facility of sending confirm e-mails to the user that their password has been changed.

You can simply drag ChangePassword Control from toolbox and drop it on a webpage. Or you can write the following code snippet :

<asp:ChangePassword ID="ChangePassword1" runat="server">
</
asp:ChangePassword>


login


This control contains two views to customize the control.
  • Change Password: The Change Password template displays the "Password", "New Password" and "Confirm Password" textbox to set a new password.

  • Success: This view shows the text which specifies that the password has been changed successfully.
Some important properties of LoginStatus control are given below:
  • ChangePasswordButtonStyle :  This property is used to change the appearance of the "Change Password" Button as its border style, background color etc.

  • ChangePasswordButtonText: This property is used to set the text of the "Change Password" button.

  • ChangePasswordButtonType: This property is used to set the button type as image, link or button.

  • CancelButtonStyle: This property is used to change the appearance of the "Cancel" Button as its border style, background color etc.

  • CancelButtonText: This property is used to set the text of the "Change " button.

  • CancelButtonType:- This property is used to set the button type as image, link or button.

  • CancelDestinationPageUrl: It specifies the URL to redirect to when Cancel button is clicked.

  • ConfirmPasswordCompareErrorMessage: It specifies the error message that is displayed when the New password and Confirm New Password textbox does not contain the same value.

  • CreateUserIconUrl: It specifies the URL for an image displayed as an icon for the Create User page.

  • CreateUserText: It specifies the text of the Create User page link.

  • CreateUserUrl: It specifies the URL of the Create User Webpage.

  • DisplayUserName: It shows the User Name if the vale is "true". By default its value is "false".

  • HelpPageUrl: It specifies the URL of the Help Page.

  • HyperLinkStyle: This property is used to set the appearance style of the Hyperlinks in the ChangePassword Control.

  • InstructionTextStyle: It is used to set the appearance of the instruction text in the ChangePassword Control.

  • MailDefinition: It is used to set the appearance of the e-mail message that is send to the user's e-mail address when user have changed their password successfully.

  • MembershipProvider: It specifies the name of the membership provider.

  • ValidatorTextStyles: It is used to change the appearance of the validoters that is used in the ChangePassword Control.

The LoginName Control:

The LoginName Control is used to display the name of the authenticated user who is logged in. If there is no logged in user on the webpage, this control will hide automatically. This control uses the LoginName class. This control is different from other control because LoginName class does not contain any method, event or property but it contains FormatString that is used to format the appearance of the LoginName Control.
To use this control, you can simply drag LoginName Control from the toolbox and drop it on a Webpage.

The CreateUserWizard Control

The CreateUserWizard Control is used to register a new user or create a new user. This control uses the Membership service that is used to store the new user information. This control is provided by the CreateUserWizard class. Using this control you can create a registration page within a few minutes.

You can simply drag CreateUserWizard Control from toolbox and drop it on a webpage. Or you can write the following code snippet :

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server">

  <WizardSteps>

   <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">

   </asp:CreateUserWizardStep>

   <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">

   </asp:CompleteWizardStep>

  </WizardSteps>

</asp:CreateUserWizard>



login


Some important properties of CreateUserWizard Control are given below:
  • AutoGeneratePassword: It is used to generate a new password automatically when its value sets to true. By default its value is false.

  • CreateUserButtonText: It is used to change the text of the "Create User" button.

  • CreateUserButtonType: This property is used to set the button type as image, link or button.

  • DisableCreatedUser: It determines if the newly created user should be allowed to log on to the website. By default its value is false.

  • DuplicateEmailErrorMessage: It displays the error message when a user entered an e-mail address that is already exists.

  • DuplicateUserNameErrorMessage: It displays the error message when a user entered a UserName that is already exists.

  • EditProfileIconControl: It specifies the URL for an image displayed as an icon for the Edit Profile webpage.

  • EditProfileUrl: It specifies the URL of the Edit Profile Webpage.

  • Email: It sets the e-mail address that is provided by the user.

  • EmailregularExpression: It sets a regular expression for the email address.

  • EmailRegularExpressionErrorMessage: It specifies the error message displayed when the email address entered by the user does not pass the Webpage’s criteria for email address.

  • EmailRequiredErrorMessage: It specifies the error message displayed when the email is empty.

  • ErrorMessageStyle: It specifies the appearance of the Error Message in the CreateUserWizard Control.

  • InvalidAnswerErrorMessage: It specifies the error message displayed when the password retrieval answer entered by the user is not valid.

  • InvalidEmailErrorMessage: It specifies the error message displayed when the email address entered by the user is not valid.

  • InvalidPasswordErrorMessage: It specifies the error message displayed when the password entered by the user is not valid.

  • LoginCreatedUser: It determines if the newly created user will be logged into the site or not.

  • PasswordHintStyle: Its changes the appearance of the password hint text.

  • PasswordRegularExpressionErrorMessage: It specifies the error message displayed when the password does not fulfill the criteria of the Website’s password pattern.

  • TitleTextStyle: It is used to change the appearance of the Title’s Text.

  • UserNameRequiredErrorMessage: It specifies the error message displayed when the User Name does not entered by the user.

  • WizardSteps: It is a collection of WizardStep controls inside the CreateUserWizard Control.
  
     
  
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top