Don't show page in browser history

Discussion in 'ASP .Net' started by Shimon Sim, Jan 6, 2006.

  1. Shimon Sim

    Shimon Sim Guest

    Hi
    Is it possible to make sure that the page doesn't show in browser history
    and won't effect Back button.
    The problem is that every postback shows as another entry for "Back" button
    and user goes through the hole history of postbacks if she wants to get to
    previous page.
    Thank you,
    Shimon
     
    Shimon Sim, Jan 6, 2006
    #1
    1. Advertising

  2. IF you don't want user to access the page by BACK button, then best would be
    to disable CACHING of pages by client browser by adding prope meta tags on
    pages. You can try the following JS on each page and it should disable
    ability to use BACK button.

    <script language="javascript">
    window.history.forward(1);
    </script>

    "Shimon Sim" <> wrote in message
    news:e47J%...
    > Hi
    > Is it possible to make sure that the page doesn't show in browser history
    > and won't effect Back button.
    > The problem is that every postback shows as another entry for "Back"
    > button and user goes through the hole history of postbacks if she wants to
    > get to previous page.
    > Thank you,
    > Shimon
    >
     
    Naveen K Kohli, Jan 6, 2006
    #2
    1. Advertising

  3. Shimon Sim

    Dan Guest

    No he means that say he had page A and on there had a update button for
    example and pressed it 3 times, thats 3 postbacks.

    When he presses back he has to press back 4 times (to get past the 3
    postbacks) in order to get to the original page.

    I actually have the same annoying problem, i am sure there is a workaround,
    their must be. I think the smartnav directive may solve it (tho it is not
    crossbrowser but i think some peopl ehave made their own that is) or you
    could make your own back button and store the original page that started the
    chain as the target, combine that with the javascript from the previous post
    and they will have to use your back button.

    --
    Dan
    "Naveen K Kohli" <> wrote in message
    news:...
    > IF you don't want user to access the page by BACK button, then best would
    > be to disable CACHING of pages by client browser by adding prope meta tags
    > on pages. You can try the following JS on each page and it should disable
    > ability to use BACK button.
    >
    > <script language="javascript">
    > window.history.forward(1);
    > </script>
    >
    > "Shimon Sim" <> wrote in message
    > news:e47J%...
    >> Hi
    >> Is it possible to make sure that the page doesn't show in browser history
    >> and won't effect Back button.
    >> The problem is that every postback shows as another entry for "Back"
    >> button and user goes through the hole history of postbacks if she wants
    >> to get to previous page.
    >> Thank you,
    >> Shimon
    >>

    >
    >
     
    Dan, Jan 6, 2006
    #3
  4. Hi Shimon,

    I assume you are using ASP.net 2.0. My suggestion is that we could place
    the code at the page to make it expire immediately. This way, when the user
    wanna click the back button at IE, it will report one page expire error
    message. Then he will have to focus on your page for the navigation. The
    sample code is:
    protected void Page_Load(object sender, EventArgs e)
    {
    Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
    Response.Cache.SetExpires(DateTime.Now.AddDays(-10));
    }

    Please feel free to let me know if you have any further question on this
    issue.

    Best Regards,
    Wei-Dong XU
    Microsoft Support
    ---------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    ---------------------------------------------------------------------------
    It is my pleasure to be of any assistance.
     
    Wei-Dong XU [MS], Jan 6, 2006
    #4
    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. VB Programmer
    Replies:
    2
    Views:
    477
    VB Programmer
    Oct 23, 2003
  2. Ed Jay
    Replies:
    4
    Views:
    565
    Rob McAninch
    Jan 8, 2006
  3. Sam Stephenson
    Replies:
    1
    Views:
    228
    Andrew Walrond
    Jun 18, 2005
  4. Replies:
    2
    Views:
    300
    nutso fasst
    Oct 17, 2006
  5. Niall
    Replies:
    3
    Views:
    170
    Niall
    Dec 6, 2006
Loading...

Share This Page