Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i disable back and forward navigation of client's browser in asp.net through C# code
Thanks in Advance
Posted

Don't. This is very annoying and the user will find a way around it (or stop using your site and visit a less annoying competitor's).

Instead, you should write your app in such a way that it can cope with moving to any page at any time. Most pages can be cached; set Cache-Control and Expires headers to allow this, and it will work as the user expects. If a page is really one-time-critical or security-critical, make it non-cachable (through headers) and have the page code check whether the application is in the right state, and display an error or a redirect (a real HTTP 303 type one) if not.
 
Share this answer
 
Comments
thatraja 9-Jan-12 13:07pm    
Right, 5!
Agree with Bob, check this Tip/Trick
Browser back button issue after logout[^]
 
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