Prevent postback saved into history of Internet Explorer

Discussion in 'ASP .Net' started by Simon, Jan 11, 2005.

  1. Simon

    Simon Guest

    Hi, I need to prevent Internet Explorer to save the page in history
    collection when it is in PostBack.
    To try do this I have put this code:

    protected override void OnLoad( EventArgs evt)
    {
    if (IsPostBack)
    Response.Cache.SetNoStore();
    .....
    base.OnLoad( evt);
    }

    With above code, when I press the back button the internet explore return
    "The page cannot be displayed" because the IE don't save the page into the
    history I think, but I need to prevent the IE history collection change, so
    when I press the back button IE display the page loaded not in postback (the
    first time that the page was loaded).
    Is possible to do this ?

    Thanks in advance.

    Simon.
     
    Simon, Jan 11, 2005
    #1
    1. Advertising

  2. Simon

    Saravana Guest

    Check out this faq,
    http://www.extremeexperts.com/Net/FAQ/DisablingBackButton.aspx

    --
    Saravana
    http://dotnetjunkies.com/WebLog/saravana/
    www.ExtremeExperts.com


    "Simon" <simon> wrote in message
    news:...
    > Hi, I need to prevent Internet Explorer to save the page in history
    > collection when it is in PostBack.
    > To try do this I have put this code:
    >
    > protected override void OnLoad( EventArgs evt)
    > {
    > if (IsPostBack)
    > Response.Cache.SetNoStore();
    > .....
    > base.OnLoad( evt);
    > }
    >
    > With above code, when I press the back button the internet explore return
    > "The page cannot be displayed" because the IE don't save the page into the
    > history I think, but I need to prevent the IE history collection change,

    so
    > when I press the back button IE display the page loaded not in postback

    (the
    > first time that the page was loaded).
    > Is possible to do this ?
    >
    > Thanks in advance.
    >
    > Simon.
    >
    >
     
    Saravana, Jan 11, 2005
    #2
    1. Advertising

  3. Simon

    Simon Guest

    Hi Saravana

    I try to do like wrote into the site, but when I push the back button
    Internet Explorer display "The page cannot be displayed" and I don' t want
    that this happens.

    Thanks.

    Simon


    "Saravana" <> wrote in message
    news:udREd.5497$...
    > Check out this faq,
    > http://www.extremeexperts.com/Net/FAQ/DisablingBackButton.aspx
    >
    > --
    > Saravana
    > http://dotnetjunkies.com/WebLog/saravana/
    > www.ExtremeExperts.com
    >
    >
    > "Simon" <simon> wrote in message
    > news:...
    >> Hi, I need to prevent Internet Explorer to save the page in history
    >> collection when it is in PostBack.
    >> To try do this I have put this code:
    >>
    >> protected override void OnLoad( EventArgs evt)
    >> {
    >> if (IsPostBack)
    >> Response.Cache.SetNoStore();
    >> .....
    >> base.OnLoad( evt);
    >> }
    >>
    >> With above code, when I press the back button the internet explore return
    >> "The page cannot be displayed" because the IE don't save the page into
    >> the
    >> history I think, but I need to prevent the IE history collection change,

    > so
    >> when I press the back button IE display the page loaded not in postback

    > (the
    >> first time that the page was loaded).
    >> Is possible to do this ?
    >>
    >> Thanks in advance.
    >>
    >> Simon.
    >>
    >>

    >
    >
     
    Simon, Jan 11, 2005
    #3
  4. Simon

    Joerg Jooss Guest

    Simon wrote:

    > Hi Saravana
    >
    > I try to do like wrote into the site, but when I push the back button
    > Internet Explorer display "The page cannot be displayed" and I don' t
    > want that this happens.


    That's a browser specific warning you can only prevent if you follow
    the Post-Redirect-Get pattern (with caching disabled).


    Cheers,
    --
    http://www.joergjooss.de
    mailto:
     
    Joerg Jooss, Jan 15, 2005
    #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. =?Utf-8?B?Um9i?=
    Replies:
    3
    Views:
    14,567
    Steven Cheng[MSFT]
    Jan 21, 2004
  2. Itai
    Replies:
    0
    Views:
    552
  3. Alain
    Replies:
    5
    Views:
    6,214
  4. Itai
    Replies:
    0
    Views:
    174
  5. Clemens Ortwickler

    Urgent How to prevent that Internet Explorer is closed

    Clemens Ortwickler, Nov 25, 2003, in forum: Javascript
    Replies:
    5
    Views:
    92
    David Leverton
    Nov 26, 2003
Loading...

Share This Page