Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2007, 10:21 AM
Registered User
 
Join Date: May 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Prevent users from using back button??

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.

 
Old January 4th, 2007, 03:38 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old January 6th, 2007, 01:09 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

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
 
Old January 8th, 2007, 11:02 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
java script to prevent users to copy image... ethantinder Javascript How-To 3 May 23rd, 2008 12:52 PM
Prevent users from accessing the database window JAdkins Access VBA 1 February 2nd, 2008 03:10 PM
How to prevent Back History after Sing Out my site hatem ASP.NET 1.0 and 1.1 Basics 2 December 28th, 2006 02:55 AM
history.back or hitting the back button won't work lian_a Classic ASP Basics 4 July 29th, 2004 12:14 AM
How to prevent submit back bveerendrakumar Classic ASP Basics 3 November 11th, 2003 01:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.