Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>

C#
protected void Page_Load(object sender, EventArgs e)
   {

           Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "disableBackButton();", true);
       }

I have put this code in my page but after adding this page code is work but it is work for all the page of the website so i am not able to get back in the previous page.
I want to disable the back button just when user click on singout and enable for remaining all the pages
Posted
Updated 6-Dec-11 5:27am
v2
Comments
Pradhan Gagan 19-Apr-12 8:47am    
Thanks yaaaaaaaaaar

1 solution

Code is added in Master Page. if so it will apply for all the pages, please move to content page.
 
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