Click here to Skip to main content
15,889,339 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am looking for disabling the browser back buttons. after searching in net I found every one did the trick to redirect to the last visited page from history. but I have to disable the browser back button completely. At any cost it would not be enabled.

any body pls help me. need that badly.
Posted

You cannot. I suggest you to open the page in a new window with all the toolbar options disabled.
 
Share this answer
 
It doesn't matter had badly you want it, it can't be done. People have been asking this question for 15 years. If using "back" is causing a problem then explain what that problem is and someone might have a solution.
 
Share this answer
 
Comments
Arkadeep De 6-Mar-15 4:48am    
I am posting some data to show data into gridview and after that if I click on the back button I got an error of "Confirm Form Resubmission". I searched and every body saying change the method from POST to GET. is there any sol to rectify this.
F-ES Sitecore 6-Mar-15 5:33am    
That's standard internet behavior that happens on any site where you go "back" to a page that you initially got to via a POST. When you go "back" normally it gets things from cache or issues a GET. If that page is a POST then it won't have been cached so your browser can't get it from the cache and it can't issue a GET as the page won't work without a POST. The solution is to re-post the data and that is what that warning is for.

What you'd have to do is render a "get" version of your page, and you can do that by taking the data from the form post, storing it in session and doing a response.redirect to the same page, and the page uses the data from the session to populate the gridview rather than using the data from the form post. That way you get a page the browser can safely cache and no more back warnings.

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