Click here to Skip to main content
15,886,030 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to logout a asp.net..i was created a login page in asp.net and the login data are passing through a seesion method and the particular page was opened .now i wanted to logout the page permentaly..
Posted
Comments
Tom Marvolo Riddle 25-Feb-14 1:18am    
In logout event redirect the page to login page.

 
Share this answer
 
Simply make one ASPX page called logout.aspx or another fancy name
in that write only two lines of code

C#
Session.Abandon(); // It will destroy your session
Response.Redirect("..");  //It will redirect you to Root of your website
 
Share this answer
 
v3
Comments
[no name] 25-Feb-14 1:36am    
where we write the code <pre lang="c#">Session.Abandon();?

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