The Login Status control displays a login link for users who are not authenticated and a logout link for users who are authenticated. The login link takes the user to a login page. The logout link resets the current user's identity to be an anonymous user. In my attached sample I am redirecting to new page after login. If login is successfully then will redirect to new page and you can see new link Sign Out.
You can customize the appearance of the Login Status control by setting the Login Text and Login Image Url properties. The login link automatically redirects to the configured login page, and the logout link automatically calls the method Form Authentication. Sign Out for logging off the user.
<asp:LoginStatus ID="LoginStatus1" runat="server"
LoginText="Sign In"
LogoutText="Sign Out"
LogoutPageUrl="~/Default.aspx"
LogoutAction="Redirect"
onloggedout="LoginStatus1_LoggedOut" />
Login Status control properties:
This is login Page.
Figure 1
After successfully login it redirect to Login Status page. If user is authenticated the Sign Out link should be enable else Sign In link should be enable
Figure 2
If you click on Sign Out, it redirects to Login Page.

ravi kumarPosted Jan 19, 2012, 3:12 PM
i have created a login and logout script....when i log out it redirects my page to login page... when i click on go back in my browser it redirects to the same page where i logged out.... any help on how to prevent this
Awadhendra TiwariPosted Aug 22, 2011, 11:14 AM
Check this Blog: http://www.mindstick.com/Blog/63/Login%20Status%20Control%20in%20ASP%20NET%203%205
kenny kennyPosted Jan 23, 2010, 1:36 AM
Thanks very much for your kindness in your contribution for assistant on ASP.net SQL. Well Mr Faisal, I"m new to ASP.NET, I will appreciate your kindness if you could help me out on this: After a user has been succesfuly authenticated and redirected to the page. I would like to know how to customerize the page for each users to bear like example user name on the top of the web, or user account: like bank account statement. Is there a way join data into sentence like user name is KENNY and account number 009988776 example: Wellcome KENNY, your account number is 009988776. I mean how to extract data and join it in sentence for each users Best regards, kenny
work offPosted Nov 4, 2009, 2:58 AM
Hi..can u plz tell me how do i display login status control on multiple pages? I m using ASP.Net 3.5,C#.... I want the username and logout label appear on every page after some1 login. How can i copy the status of login control on multiple pages?
ankitaPosted Oct 9, 2008, 2:53 PM
I started doing this by seeing ur code but it is giving an error that login class is not declared and so many errors .If possible can u plz send the entirw piece of code so that I can develop it .ActuallyI am a beigner in .net so facing a lot of problem.Thanks in advance.my email id is [email protected]