back button - disable

  • Thread starter Thread starter belgie
  • Start date Start date
B

belgie

Is there a way to prevent the user from using the browser Back Button to go
back to a previous page in an ASP.NET application?

Thanks!
Bill
 
belgie said:
Is there a way to prevent the user from using the browser Back Button
to go back to a previous page in an ASP.NET application?

Have the previous page expire immediately. When the user hits Back button
of the browser, the page will have expired.
 
I tried this:
Response.Cache.SetExpires(Date.Now)
in the Page_Load event, but it didn't seem to work. I could still go back
to it with the back button.

Thanks!
 
You need to use Setcacheability property of the response object. That will
kill the back button dead in its tracks. Actually, the button will still be
there, after clicking it, you will get a message - page has expired from
cache.
 
Back
Top