In some cases we need to implement this functionality in our application,
suppose our application contains the login page to user and after login, user is entered into application and user log outs from application then user should not see application other pages by clicking browser's back button. He should re-login into system by provided login window. So like this we have to implement this
functionality in many application as per project requirement. So for such implementation following JavaScript function is useful, we just need to add one function in our aspx page and call it in body on unload event.
The JavaScript function is as follow:
==========================================================
<script language="javascript" type="text/javascript">
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>
===========================================================
Call this function on Body tag , refer following line of code:
===========================================================
<body onunload="disableBackButton()">
</body>
===========================================================
This is how it works.
I hope this will help you................
Thanks..
suppose our application contains the login page to user and after login, user is entered into application and user log outs from application then user should not see application other pages by clicking browser's back button. He should re-login into system by provided login window. So like this we have to implement this
functionality in many application as per project requirement. So for such implementation following JavaScript function is useful, we just need to add one function in our aspx page and call it in body on unload event.
The JavaScript function is as follow:
==========================================================
<script language="javascript" type="text/javascript">
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>
===========================================================
Call this function on Body tag , refer following line of code:
===========================================================
<body onunload="disableBackButton()">
</body>
===========================================================
This is how it works.
I hope this will help you................
Thanks..
Comments
Post a Comment