How to: Add a LoginStatus Button to an ASP.NET Web Page
To allow users to log in to an ASP.NET application that uses ASP.NET membership (forms authentication) for user authentication, you can use the LoginStatus control. The LoginStatus control detects a user's authentication status. If a user is not authenticated, the control displays a button that directs the user to the application's login page. If the user is authenticated, the LoginStatus control displays a button that users can click to log out of the application.
Note
By default, ASP.NET membership and forms authentication is configured to work with a page named Login.aspx. You can change the default login page name in the application's configuration file by setting the loginUrl attribute of the <forms> element.
By default, the LoginStatus control renders a button. You can configure the button text by setting the LoginText property. Alternatively, you can configure the LoginStatus control to display an image (an ImageButton control).
To add a LoginStatus button to an ASP.NET Web page
Add a LoginStatus control to your page.
Customize the text displayed in the button by setting the LoginText and LogoutText properties.
To add a login or logout images
Add a LoginStatus control to your page.
Set the LoginImageUrl and LogoutImageUrl to the URL of the image to display as login and logout images, respectively.
Optionally customize the alt text displayed for the image by setting the LoginText and LogoutText properties.