Click here to Skip to main content
15,885,895 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
we make a custom login control userid password saved in custom database. when user login then reach to home page after logout, login page provide ; but when we use browser back button then again it provide home page.how to stop it because we want that after using browser back button it send user to login page.
Posted

 
Share this answer
 
Comments
P.Salini 16-Apr-12 6:15am    
5!
sravani.v 16-Apr-12 7:52am    
thank you salini :)
Hi friends,

Please find the below code...
this may help you.......


JavaScript
<script type="text/javascript">
    window.history.forward();
    function noBack() { window.history.forward(); }
</script>

HTML
<body  önload="noBack();">
    onpageshow="if (event.persisted) noBack();" onunload=""></body>


If this is not satisfied then click below link......
http://viralpatel.net/blogs/2009/11/disable-back-button-browser-javascript.html[^]
 
Share this answer
 
v4
Comments
Ragul Vasudevan 26-May-13 1:19am    
Not working my friend... In all the websites they have given this code only... But its not working for me
Hi ,
Try to Google First
Search[^]
Best Regards
M.Mitwalli
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900