Click here to Skip to main content
14,984,270 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to disable browsers back button using asp.net(c#)

I am in need of that code to apply in the login part


kindly help me

kishore R
Gis Solutions
Posted

And, like I said, anyone who's interested, can kill any javascript that is inserted into the page to kill the back button. It's not worth doing, it annoys your honest customers, and means nothing to your dishonest ones.
   
You can't. This gets asked all the time, and htere are js hacks that you can easily find with google ,that work so long as the user doesn't want it not to. Any code you find to stop the back button, I can defeat and so can any other determined user. Instead, you should look at writing your pages properly. Turn off caching. Make sure all pages check if the user is logged in and redirect to the login page if they are not. That's all.
   
CG's reply is best for your question, you should turn off caching. but you can forward the page while clicking back button in browser by following javascript. Just add this to your page.
<script type="text/javascript">history.forward();</script>
   

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