Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i just want to disable browsers back option in browser window

when user submits data navigates to next page

when user clicks on back button on browser window

moves to previous submited form


i want to restrict the user to move backward pages

can any one of u tell me please the way to restrict
Posted
Comments
Sergey Alexandrovich Kryukov 5-Oct-11 9:50am    
Broken Google? It happens... :-)
--SA
Simon Bang Terkildsen 5-Oct-11 10:12am    
Google only has an uptime of 5% didn't you know?
I'm lucky though Google is always up when I need it :)
Sergey Alexandrovich Kryukov 5-Oct-11 10:16am    
Yes, I also observe downtime of Google very rarely. I have no idea why -- looking at the questions, anyone could reasonably estimate the downtime of this otherwise useful service of about 95%. :-)
--SA

ASP works only on the server; it cannot be used to affect the behavior of the browser. You can use client scripting languages like Javascript to change some things in the browser, but disabling the Back button is not one of them. In short, you cannot do what you want.

What you can do is create an intermediate redirect page. The data is entered on page A and the user clicks Submit. The data is processed and the user is sent to page B. The only content on page B is a meta HTTP-EQUIV="REFRESH" tag that will immediately redirect the user to page C, which tells the user that the data has been received. If the user clicks the back button from page C, they will go to page B, which immediately redirects them back to page C.

Be warned, though, that this kind of forced redirection tends to be very annoying for your users.
 
Share this answer
 
Comments
Simon Bang Terkildsen 5-Oct-11 10:12am    
my 5
Sergey Alexandrovich Kryukov 5-Oct-11 10:21am    
Your points are very good. However, the usual legitimate way of solving this problem is manipulating a browser's cache and history. Please see the advice in the discussions I references in my answer.
--SA
Gregory Gadow 5-Oct-11 11:24am    
That is the usual way, yes, but tampering with the browser's history without the user's consent is not considered legitimate. I believe several browsers have disabled this ability because it has been used maliciously.
Espen Harlinn 5-Oct-11 10:58am    
5'ed!
This is a very popular question. There are many place where you can find a solution.

Check out these discussions:
how to disable back button in asp.net[^],
http://forums.devarticles.com/javascript-development-22/is-there-a-way-to-disable-the-back-button-5408.html[^].

Good luck,
—SA
 
Share this answer
 
Comments
Simon Bang Terkildsen 5-Oct-11 10:12am    
+5 Google was not down, amazing :P
Sergey Alexandrovich Kryukov 5-Oct-11 10:17am    
Thank you, Simon.
Yes, wonderful; I had enough up-time to get search results twice! What a luck!
--SA
Espen Harlinn 5-Oct-11 10:58am    
5'ed!
Sergey Alexandrovich Kryukov 5-Oct-11 11:10am    
Thank you, Espen.
--SA

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