Use of the ASP. NET login Control

Source: Internet
Author: User

1. control whether the login control is visible During User Logon: Set the visiblewhenloggedin attribute to false.

2. control whether to store authentication tokens in persistent cookies
If you want the control to display the "remember me" check box next time, set the displayrememberme attribute to true. If you select the "Remember me next" check box during logon, the authentication token will be stored in the browser's persistent cookie.

If you want to select the "remember me" check box by default, set the remembermeset attribute to true.

If you want to store the authentication token in the persistent cookie without selecting to clear the "remember me" check box next time, set the remembermeset attribute to true, set the displayrememberme attribute to false. This is not recommended for websites that can be accessed from public computers used by multiple users, because the user's persistent identity authentication token may be used by unnecessary users.

<Asp: Login ID = "login1" runat = "server" displayrememberme = "false" remembermeset = "true">
</ASP: Login>

3. Add the help link to the login Control
To add a link to the login control to forward the user to the URL where he or she can create a new user account, set the createusertext attribute to text (such as click here to register (Click here to register), and set the createuserurl attribute to the URL of the Help Page (such ~ /Register. aspx ).

To add a link to the login control to convert the user to a URL that can restore the user password, set the passwordrecoverytext attribute to text (for example, forgot your password? (Forgot password ?)), Set the passwordrecoveryurl attribute to the URL of the Help Page (for example ~ /Recoverpassword. aspx ).

To add a link to the login control to forward the user to the help URL, set the helppagetext attribute to text (such as need help? (Do you need help ?)), Set the helppageurl attribute to the URL of the Help Page (for example ~ /Userhelp. aspx ).

 

4. Add the image to the login Control
To use an image instead of the "Log on" button, set the loginbuttonimageurl attribute to the URL of the login image file, as shown in ~ /Images/login.gif.

You can also use the passwordrecoveryiconurl, createusericonurl, and helppageiconurl attributes to include the images linked to the user URL creation, password recovery URL, and help URL.

 

5. Use a template for the logon Control

Right-click the control and select "convert to template" from the shortcut menu ".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.