I am using Mozila fire fox as browser and I want to stop back button of an my asp.net webpage what i can do??
I tried the window.history.back(1) but it is not working
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Andrew FensterRank #983 · 2K reputationPosted Mar 22, 2011, 7:27 AM EDT
Is so, you're asking all the same questions everyone else asks. Unfortunately, there's NO good fix. You can try to block the back button with client side Javascript. Even if you succeeded in coming up with Javascript to override the user's effort to use the back button, they have other options. They can modify or turn off your Javascript. They can use the browser history to go back instead. You can't completely block the user from seeing the last cached page in the browser with Javascript. You can make it harder, but you can't stop it.
If you really want security, you have to put this in your code:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now); //or a date much earlier than current time
This keeps the browser from caching your page. YOur performance is worse, but it's the only way to really secure your page. The user can still hit the back button, but there's nothing cached for the user to see when he goes back.
Suthish NairRank #92 · 22.8K reputationPosted Mar 22, 2011, 8:14 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 24, 2011, 10:34 AM EDT