Subject: Prevent users from using back button??
Posted By: Phrozt Post Date: 1/4/2007 9:21:03 AM
It's a bit more complicated than what the topic says...

I have a page that dynamically creates checkboxes (one for each line in a repeater that corresponds to the record retrieved for that line).  Because they are dynamically created, when users check them, submit, then go back to the page and submit again, the page blows up.

The user swears up and down that this is not what he's doing... but I've tried to recreate his error over and over, and that's the only way I can do it.  It also ONLY happens with him (about 7 ppl use the app).

How can I set up the page so that if he hits the back button, it says page expired and postBacks the page to prevent bogus controls from being redrawn?  I've tried several chaching options to no avail.

Reply By: planoie Reply Date: 1/4/2007 2:38:54 PM
You can set the page expiration explicitly so that any request for that page will be forced to go back to the server for it.  Of course, since the user already has that page in his browser, it could be cached ('cache'-22 if you will :-O ).

-Peter
Reply By: gaurav_jain2403 Reply Date: 1/6/2007 12:09:32 AM
I don't fully agree with you. I have seen in some web pages that when I push the "BACK" button, simply no page displays(I guess that it means no previous page is cached there). There must be some other logic for doing it.

Gaurav
Reply By: planoie Reply Date: 1/8/2007 10:02:13 AM
Well, in all my time answering this same question, and trying to solve it myself, I've yet to find a way to monkey with the browsers back action.  The only way around it has been:
1) Open a new browser window (which would have no history and thus a disabled back button)
2) Force immediate expiration of the page you don't want people to back into
3) Launch the site into a browser without the navigation toolbar (but of course then you have to deal with disabling the browser window context menu so they can't access 'Back' from a right/context click)

-Peter

Go to topic 53988

Return to index page 70
Return to index page 69
Return to index page 68
Return to index page 67
Return to index page 66
Return to index page 65
Return to index page 64
Return to index page 63
Return to index page 62
Return to index page 61