Hi Tim,
As for how to prevent the browser navigate a certain page in the history
list when we hit back button, here are some of my suggestions:
Generally, when we navigate to a page in the browser, the url will be loged
into the Browser's history lists. And when we hit "back" button, the
browser will go back according to the history url array. One way to avoid
the current page's url be added into the history list is using the
"window.location.replace(url)" javascript function, this method will
redirect the browser location to another url and the important thing is
that it won't add a new item in the history list but replace the previous
page's history url item. So as for your situation, you can do the folliwing
steps to implement your task:
1.use any means to redirect from page1.aspx to page2.aspx
2. in page2.aspx , we use clientside script to redirect rather than use
serverside code, for example , use the following function
<script language="javascript" >
function NoHistoryRedirect(url)
{
window.location.replace(url);
}
</script>
in a button's client click event , call "NoHistoryRedirect('page3.aspx');"
this will change the current page's location to the speicified url and
replace the url in the browser's history url list. So that when we hit
"back" button, it won't stop at page2.
Please have a try to see whether it helps. thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx