Ohhh, this is a fun one... By default, there is no way to trap for a user
pushing the back button or for that matter the back menu (the menu that
drops down when a user presses the drop-down arrow to the right of the back
button). But, here are some things that you can try...

In your page, you can hookup the window.onunload() event in JavaScript and
force a postback using document.forms[0].submit(). The problem with this is
that you would have to dynamically determine where you are in your
application and where you want to go. Not always an easy task. Usually,
what I do is if I am forcing something on the user, I make sure that my web
app uses a new window launched from their previous window. If I need to
disable the back button, I use this code...

<script language="JavaScript1.5">
function NoBackButton()
{
window.alert('Sorry, you cannot navigate using the back button of your
browser. Please use the menu navigation to the top and the left.');
return false;
}

window.onunload = NoBackButton;
</script>

An alternate to this would be:

document.forms[0].submit();
return false;

That will cause a post back to occur with the current values of your page.

HTH,

Bill P.

On Tue, 5 Aug 2003 16:18:23 +0200, pschrader <pschrader@bieber-gruppe.de>
wrote:
> Hi !
>
> I'm modifyinging an ASP.NET application using Visual Studio .NET 2003.
>
> By pushing MS Internet Explorer's "backward arrow",
> I can return to the previously loaded page.
> However, usually (according to my web experience) it'll show exactly as
> it
> was.
> E.g., if previously it showed the time of clock,
> it'll show exactly the same time of clock again.
> I.e., the time of clock is n o t updated dynamically.
> Data from a DB aren't updated either,
> although they may have changed in the meantime.
>
> However, the other day I had the chance to experience a web application
> that was able to dynamically update the contents of a page in this
> situation.
> I don't know how it works, but it can be done.
>
> By experiment (debugger !) I was able to confirm
> that my application doesn't call Page_Load
> when I push the "backwards button".
>
> Can I force my application to make a server round trip
> when IE's "backward button" is pushed ?
> Must I use client side scripting to do the trick ?
>
> How can such dynamical updates be achieved in ASP.NET ?
>
> Your kind help would be appreciated.
>
>
>


--
Using M2, Opera's revolutionary e-mail client: [url]http://www.opera.com/m2/[/url]