Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir

I have a query regarding disable browser back button.

I want that when i click on logout button then back button is automatically disable so that no one can go back to previous page in asp.net application.

Please send the solution as soon as possible.

Thanks to all
Posted

 
Share this answer
 
Comments
Sandeep Mewara 26-Apr-12 15:13pm    
my 5! :)
m@dhu 27-Apr-12 2:07am    
Thanks for the trick.
Write following code in page load event of your page:

C#
Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetAllowResponseInBrowserHistory(false);


It will not disable the back button but it will disable the back button functionality.
 
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