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.