在asp.net中注销后,如何禁用浏览器的后退功能? [英] How can i disable the browser’s back functionality after logout in asp.net?
本文介绍了在asp.net中注销后,如何禁用浏览器的后退功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要在注销后禁用浏览器的后退按钮.
I want to disable the browser's back button after log out.
我已经将会话 ["session-id"]
设置为注销事件时的null.
I have already set session ["session-id"]
to null on log out event.
但是当我按下浏览器的后退按钮时:
But when I am pressing back button of the browser :
它将重定向我到我已经注销的安全页面.
请给我有关此问题的任何解决方案
Please Give me any solution about this problem
推荐答案
下面的Javascript代码可能会帮助您...
The below Javascript code may help you...
<script type = "text/javascript" >
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
在您不想返回的页面中使用代码...
use the code in a page where you don't want to go back...
这篇关于在asp.net中注销后,如何禁用浏览器的后退功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文