By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,275 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,275 IT Pros & Developers. It's quick & easy.

Disable client browser's Back/Forward button?

P: n/a
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.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Terry Olsen" <to******@hotmail.com> wrote in message
news:u6***************@TK2MSFTNGP15.phx.gbl...
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.

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.