Re: After pushing IE's "backwards arrow", how can I have my page be dynamically updated ?

Discussion in 'ASP .Net' started by Bill Priess, Aug 5, 2003.

  1. Bill Priess

    Bill Priess Guest

    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 <>
    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: http://www.opera.com/m2/
     
    Bill Priess, Aug 5, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZVhzZXJhcGg=?=

    How can I implement the "Pushing" mode in Asp.Net application

    =?Utf-8?B?ZVhzZXJhcGg=?=, Nov 19, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    546
    bruce barker
    Nov 22, 2004
  2. Newsguy
    Replies:
    4
    Views:
    405
    Gary Dale
    Oct 22, 2005
  3. Mike Whittemore
    Replies:
    3
    Views:
    392
    Mike Whittemore
    May 4, 2004
  4. Dmitry Korolyov

    Datagrid not updated during delete, but updated during insert and update

    Dmitry Korolyov, Sep 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    416
    Dmitry Korolyov
    Sep 22, 2003
  5. Replies:
    1
    Views:
    102
    Thomas 'PointedEars' Lahn
    Nov 15, 2005
Loading...

Share This Page