本文介绍了禁用Web浏览器的后退按钮,在C#中asp.net登录后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何无力用户回到previous他们登录后无法登陆页面?是否有可能这样做吗?
How to unable user to go back to previous not login page after they login? Is it possible to do that?
推荐答案
在C#试试这个
public void disablebrowserbackbutton()
{
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoServerCaching();
HttpContext.Current.Response.Cache.SetNoStore();
}
客户端
<script type="text/javascript">
function preventBack() {
window.history.forward();
}
setTimeout("preventBack()", 0);
window.onunload = function() {
null
};
</script>
这篇关于禁用Web浏览器的后退按钮,在C#中asp.net登录后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!