Back Button: Best way to deal with

  • Thread starter Thread starter GaryDean
  • Start date Start date
G

GaryDean

After a lot of Google research, there doesn't appear to be a easy solution
for detecting or preventing a user of an asp.net application from using the
backbutton.

Is there any way to deal with this problem?
 
Google javascript and back button. I'm not aware of any specific features
in the asp.net framework for handling this, though.

You can somewhat block the back button with javascript, but you can't
completely throw your visitors into quicksand forever. It's not very nice,
anyway.
 
try the following

<html>
<head>
<script language="javascript">
history.forward();
</script>
</head>

HTH
Ken
 
After a lot of Google research, there doesn't appear to be a easy solution
for detecting or preventing a user of an asp.net application from using the
backbutton.

Is there any way to deal with this problem?

I think there's an eent on the "window" object called "unload", but
this is basically not playing with fire but more like playing with
NUKES!!
DON'T do it!!
 
Have a look at the rest of this thread :)

I have - the "solution" you have been given is not guaranteed to work on all
browsers on all platforms - you simply can't rely on it...
 
Mark,
hmmm... I tested it on both IE6&7 and Firefox on XP and Vista and it works
fine. This is a corp app and I.E. is enforced so it looks like it will be
fine. Do you know of any specific browsers or platforms (that support
javascript) where it does not work?
Gary
 
hmmm... I tested it on both IE6&7 and Firefox on XP and Vista and it works
fine. This is a corp app and I.E. is enforced so it looks like it will be
fine. Do you know of any specific browsers or platforms (that support
javascript) where it does not work?

http://www.boutell.com/newfaq/creating/backbutton.html

If you absolutely must use this, then at least use the correct syntax i.e.

<script type="text/javascript">

rather than

<script language="javascript">

http://www.w3schools.com/tags/tag_script.asp
 
Try this
<html>
<head>
<script language="javascript">
history.forward();
</script>
</head>

HTH
Ken
 
Back
Top