back button - disable

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
 
P

Peter Wu

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.
 
B

belgie

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!
 
A

Alvin Bruney

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top