Back Button: Best way to deal with

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?
 
M

Mark Rae

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.

That's right.
Is there any way to deal with this problem?

No.
 
K

K. Abit

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.
 
K

ken

try the following

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

HTH
Ken
 
T

Thomas Hansen

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!!
 
M

Mark Rae

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...
 
G

GaryDean

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
 
M

Mark Rae

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
 
K

ken

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

HTH
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top