Hi all . I have tried different methods but i am still unable to disable my browsers back button. plz help me out. some of the methods that i have tried are -:
1)
on logout click i wrote this code in my .aspx.cs file
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
2) Also i tried this java script function
<script type="text/javascript" language="javascript">
function cancelBack()
{
if ((event.keyCode == 8 ||
(event.keyCode == 37 && event.altKey) ||
(event.keyCode == 39 && event.altKey))
&&
(event.srcElement.form == null || event.srcElement.isTextEdit == false)
)
{
event.cancelBubble = true;
event.returnValue = false;
}
if (window.event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
}
}
</script>