Click here to Skip to main content
14,931,892 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.
<script language="JavaScript">

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.

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

Reference Link :- Disable Browser Back Button Using Javascript ASP.NET[^]
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 not go back.for internal pages it has to work.
"Disable Browser's back button", have a look at several Question-Answer discussions posted on CodeProject earlier on this topic.

Check this

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