Page_Load on browser Back button

Discussion in 'ASP .Net' started by Ian Semmel, Jan 14, 2008.

  1. Ian Semmel

    Ian Semmel Guest

    Is there a way to get the Page_Load event to fire if the user clicks the
    Back button on the browser rather than clicking a hyperlink ?
    Ian Semmel, Jan 14, 2008
    #1
    1. Advertising

  2. Ian Semmel

    Leon Mayne Guest

    "Ian Semmel" <> wrote in message
    news:...
    > Is there a way to get the Page_Load event to fire if the user clicks the
    > Back button on the browser rather than clicking a hyperlink ?


    I don't think so, because it's down to the browser to post back to trigger
    the event, and most browsers just pull back a cached copy. If there was a
    postback previously on the page then in IE the user gets the "Page has
    expired" messagebox which prompts them to repost the form data, but they
    might not, and reposting the data may mess your app up.

    You could try telling the browser not to cache the page, but I don't think
    this would work. You're better off telling the user not to click back in
    their browser, and providing a very clear "Back" button or hyperlink.
    Leon Mayne, Jan 14, 2008
    #2
    1. Advertising

  3. If you have prevented caching on the original page, then yes the browser
    would actually re-request the page rather than displaying the content from
    it's cache.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    MetaFinder: http://www.blogmetafinder.com


    "Ian Semmel" wrote:

    > Is there a way to get the Page_Load event to fire if the user clicks the
    > Back button on the browser rather than clicking a hyperlink ?
    >
    >
    >
    Peter Bromberg [C# MVP], Jan 14, 2008
    #3
  4. Ian Semmel

    bruce barker Guest

    disabling caching causes the repost dialog box. you are better off designing
    your site to allow use of the back button and caching. you users will be
    happer. you shoudl also handle repost of the same page (refresh).

    -- bruce (sqlwork.com)


    "Peter Bromberg [C# MVP]" wrote:

    > If you have prevented caching on the original page, then yes the browser
    > would actually re-request the page rather than displaying the content from
    > it's cache.
    > -- Peter
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > MetaFinder: http://www.blogmetafinder.com
    >
    >
    > "Ian Semmel" wrote:
    >
    > > Is there a way to get the Page_Load event to fire if the user clicks the
    > > Back button on the browser rather than clicking a hyperlink ?
    > >
    > >
    > >
    bruce barker, Jan 14, 2008
    #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. Todd A
    Replies:
    1
    Views:
    2,211
    bruce barker
    Dec 3, 2004
  2. Amelyan
    Replies:
    0
    Views:
    733
    Amelyan
    Jun 5, 2005
  3. Amelyan
    Replies:
    4
    Views:
    7,681
    sajidali3387
    Dec 9, 2011
  4. =?Utf-8?B?am9l?=
    Replies:
    1
    Views:
    2,228
    Peter Bradley
    Dec 5, 2006
  5. Amelyan

    Force Page_Load/PostBack on browser's back button click

    Amelyan, Jun 5, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    479
    Amelyan
    Jun 5, 2005
Loading...

Share This Page