Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am using the same button for log in and log out.when i log out,if i click on browser back button iam going back.i used this below code.
XML
<script language="JavaScript">
  javascript:window.history.forward(1);
</script>


the above functionality,disabling browser back button on all pages.
i want to disable only when iam log out.
please help to solve this issue.
Posted

Just put this javascript on the html section of aspx page above head section
XML
<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>

Reference Link :- Disable Browser Back Button Using Javascript ASP.NET[^]
 
Share this answer
 
Comments
kishorek206 5-Dec-11 7:09am    
this code is working for all pages.i.e iam using master page for 15 pages.if i wrote this code,iam not able to navigate from one page to another page.i need code for when i log out,browser back button do not to work.it not go back.for internal pages it has to work.
 
Share this answer
 
"Disable Browser's back button", have a look at several Question-Answer discussions posted on CodeProject earlier on this topic.

Check this
 
Share this answer
 
v2

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