esb01
01-15-2005, 09:49 PM
The only problem I have is how to prevent a user to go back on the browser's back button click after being logged out.
1. The following method is fine since the Back Button doesn't work -
<input onClick="window.location.replace('login.asp')" type=button value="Log Out">
2. But <a href="login.asp">Log Out</a> doesn't work properly unless I add Response.Cache.SetCacheability(HTTPCacheability, NoCache) in the Page Load event.
Would anybody tell me what is the difference between href and window.location.replace and why do they work differently?
Also which method is preferred?
Thanks
1. The following method is fine since the Back Button doesn't work -
<input onClick="window.location.replace('login.asp')" type=button value="Log Out">
2. But <a href="login.asp">Log Out</a> doesn't work properly unless I add Response.Cache.SetCacheability(HTTPCacheability, NoCache) in the Page Load event.
Would anybody tell me what is the difference between href and window.location.replace and why do they work differently?
Also which method is preferred?
Thanks