Page_Load on browser Back button
am 14.01.2008 09:22:56 von Ian SemmelIs 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 ?
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"
news:usZQrZoVIHA.5980@TK2MSFTNGP04.phx.gbl...
> 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.
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 ?
>
>
>
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 ?
> >
> >
> >