当我在注销后单击后退按钮时,Privius页面显示.. [英] When I Click Back Button After Logout ,Privius Page Show..
本文介绍了当我在注销后单击后退按钮时,Privius页面显示..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每个想法都运行良好但是当我从我的网站使用注销时,他们按下浏览器的按钮,那时网站的私有页面被看到...
i已经在asp.net上用c#完成了网站...
现在我做了4它..所以退出后,没有人能看到网站的私人页面..
every think is running fine but when use logout from my site then they press back button of browser that time privios page of website seen...
i have done website in asp.net with c#...
now what i do 4 it.. so after logout ,no one can see privios page of website..
推荐答案
嘿Sangeet,看看吧
http://www.codeproject.com/Tips/135121/Browser-back-button-issue-退出后
谢谢
hey Sangeet, just check it out
http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout
thanks
试试这个
try this
page_load()
{
if(Session["userLogged"]=="") // check for the session
{
response.redirect("loginpage")
}
}
<script type="text/javascript">
function preventBack() { window.history.forward(); }
setTimeout("preventBack()", 0);
window.onunload = function () { null; };
</script>
在登录页面上使用此选项可防止历史记录转发。在Hime页面上放置以下代码段:
Use this on the Login page to prevent the history forward. And on the Hime page place the below snippet:
<script type="text/javascript" language="javascript">
function DisableBackButton() {
window.history.forward();
}
DisableBackButton();
window.onload = DisableBackButton;
window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton(); }
window.onunload = function () { void (0); };
</script>
希望这会有所帮助。
谢谢:)
Hope this helps.
Thank you :)
这篇关于当我在注销后单击后退按钮时,Privius页面显示..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文