Page_Load on browser Back button

  • Thread starter Thread starter Ian Semmel
  • Start date Start date
I

Ian Semmel

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 said:
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.
 
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)
 
Back
Top