Hi,
After user has logged out i am redirecting user to home.aspx and from here i do not want user to be able to go back using browser back button.. How can i do it? I used this code in javascript : <script type="text/javascript"> javascript:window.history.forward(1); </script> This does not work for me. In all pages i am using Master Pages.. Thanks for the help in advance
Refer here
http://www.aspsnippets.com/Articles/Disable-Browser-Back-Button-Functionality-using-JavaScript-in-ASP.Net.aspx
Sir,
That is not working for me.. I am using master page and i have written the javascript in the content place holder..
Put it in the content placeholder of the page and not master page
If you have 2 pages pageA and pageB and user goes from pageA -> pageB and you want to stop him from coming back to pageA put the script in content place holder of pageA
When user clicks on logout its a link to another page logout.aspx where i write the session.abandon() at page load event of logout.aspx.. After which user is redirected to home.aspx... If user is in customer.aspx and clicks on logout customer.aspx>logout.aspx>home.aspx... Now where do i write the javascript? Should i write in logout.aspx page?
Yes. Write the script on the page where you don't want user to go back using browser back button. In your case it is logout page
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.