Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOWTO Control a web page against Refresh/F5/Back.

1 view
Skip to first unread message

ATS

unread,
Jul 1, 2005, 10:53:03 AM7/1/05
to
HOWTO Control a web page against Refresh/F5/Back.

Please help,

I want to build a web page that control its navigation. I do not want the
browser to be able to let the user refresh, back, forward, or any form of
navigation without the web page controlling it. I want the web page to trap
the event, totally prevent it without any GUI, and then know wether it was
for refresh, back, forward, or even close, so that it can pass the event onto
its logic to handle the event the way I need it to.

I would also like for this to work across IE, Netscape, and Opera, but this
latter desire is not necessarily that important.

Now I have used script with such thing as body.onbeforeunload, and set the
returnValue to a string to prompt the user, but this is FAR from what I need.
It is totally GUI based, it doesn't let script know whether the navigation to
leave the web page was for refresh, forward, back, or just close.

I've also used things like trapping the F5 key, or if the event.clientY < 0,
but they do not work well. I need something more powerful.

Any ideas?

ATS

unread,
Jul 1, 2005, 12:56:03 PM7/1/05
to
I have new information on this issue.

I want to take a moment and explain my issue in another way. I'm seeking a
solution to do the following:

1) Detect and trap browser navigation like refresh, back, forward, and close
without having to graphically show the event to the user.
2) Know what the event was, as either refresh, back, forward, or close.
3) Solution does not have to be script. Maybe even .NET or ActiveX, and even
particular to IE.
4) What ever the solution, it has to have 100% pure Web deployment.

Jeremy Chapman

unread,
Aug 8, 2005, 1:37:46 PM8/8/05
to
To disable the back button you can use some java script:
<script language=JavaScript>

history.go(1);
</script>

this will ensure that if the user clicks the back button, it will not bot
back, it will return to the same page. Of course it will not disable the
back button, but it will effectively render it useless.

I don't think you can disable the refresh/f5 functionality, but with asp, or
asp.net you can write code to detect it server side.


"ATS" <A...@discussions.microsoft.com> wrote in message
news:2141F0D8-290F-484C...@microsoft.com...

ATS

unread,
Aug 8, 2005, 1:56:01 PM8/8/05
to
Thank you
0 new messages