Disable client browser's Back/Forward button?

T

Terry Olsen

Is there any way to disable the client browser "Back" and "Forward"
buttons while on my site? Or how would I go about knowing that a page
hit is caused by a back/forward navigation?

I have discovered that my web app is definately NOT Back/Forward safe.
It's really messing with my SQL data bigtime.

Thanks.
 
S

Steve C. Orr [MVP, MCSD]

There is no good way to disable the buttons.
If you pop open a new browser window you can hide the buttons but the user
can still navigate with the keyboard.
If you pop open a new browser windows then the back button will be disabled
because that window has no history.

A better approach is to disable caching so a the page must be requested
fresh each time.
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-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

Top