ASP. NET-how: add the logon button to the ASP. NET webpage

Source: Internet
Author: User

To enable users to log on to ASP. NET applications that use ASP. NET membership (Forms authentication) for user authentication, you can use the loginstatus control. The loginstatus control checks the user's authentication status. If the user has not been authenticated, the control displays a button that directs the user to the application logon page. If the user has been authenticated, a button is displayed in the loginstatus control. You can click this button to log out of the application.

Note: by default, ASP. NET membership and forms authentication are configured to be used with pages named login. aspx. You can change the default logon Page name by setting the loginurl attribute of the <forms> element in the application configuration file.

By default, loginstatus displays a button. You can configure the button text by setting the logintext attribute. In addition, you can configure the loginstatus control to display images (imagebutton control ).

 

1. Add the logon button to the ASP. NET webpage

1. Add a loginstatus control to the page.

2. Set the logintext and logouttext attributes to customize the text displayed on the button.

 

2. Add login or logout Images

1. Add a loginstatus control to the page.

2. Set loginimageurl and logoutimageurl to the URL of the login image and the image displayed after logout.

3. Alternatively, you can set the logintext and logouttext attributes to customize the alt text displayed in the image.

Related Article

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.