Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the coading of LogOut of a website?
Posted

on click of logout button, add the following code:

C#
FormsAuthentication.SignOut();
Session["Name"].Abandon();
Response.Redirect("Login.aspx");
 
Share this answer
 
Comments
Janardan Pandey 30-Dec-11 2:52am    
Not working sir.It is redirecting to index.aspx but when i click on back button of explorer the page will again go previous page.
just set session to null if you are using or where ever you are maintaining values. and write this on logout button.
C#
FormsAuthentication.SignOut();

hope this will help you.
Don't forget to mark as answer if it helps. :)
 
Share this answer
 
Comments
Janardan Pandey 30-Dec-11 2:54am    
not working
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900