In my opinion It's not really a good idea to control the way users navigate through the browser. Unless you really need to do this here are a couple of things you can do..
put this in your Global.asax file. But this will expire all pages after a request is made to say a DB.
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
Response.AddHeader("pragma", "no-cache")
Response.AddHeader("cache-control", "private")
Response.CacheControl = "no-cache"
End Sub
this will stop users from going back and forth.
The other option would be to simply use the window.open method and say toolbar=no and menubar=no
again, you may want to think about this before trying to control the way users browse. I only disable the toolbar etc when opening up something like a printable version of a page.
I'm sure you will get more examples from the pros on this.
If anyone messed with my browser setting like not allowing me to go forward and backwards I wouldn't be very happy and would probably leave your site. It should be up to me where I want to go and how to use my browser, and it should be up to the website developer to cope with this.
Sorry I should have been more clear.
Hitting the back button returns me to the login page which contains the previous login info, which I want to avoid.
But you still shouldn't disable the option that allows me to go back a page (even if it is to your login page). If you want to remove the contents of certain controls when I do go back, then fair enough, but don't stop me using my browser as I want to!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.