Wednesday 9 October 2013

Disable Browser Back Button



Javascript


<script type = "text/javascript" >
function disableBackButton()
{window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>

For internet explorer: <body onload="disableBackButton()">
If you are using firefox then use <body onunload="disableBackButton()">


C#  Asp.net

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(true);

No comments:

Post a Comment