[英]back button in asp.net showing history in IE11
My below code is working fine in Firefox and chrome.But when i open website in IE 11 and do login and then after that I press logout button and then after that I press back button then my previous data(history page) is appearing.How can i solve this issue in IE11. 我下面的代码在Firefox和chrome中可以正常工作。但是当我在IE 11中打开网站并登录时,然后按注销按钮,然后按返回按钮,则出现了我以前的数据(历史页面)。我可以在IE11中解决此问题吗?
My logout button code is following 我的注销按钮代码如下
// Code disables caching by browser. Hence the back browser button
// grayed out and could not causes the Page_Load event to fire
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
Response.Redirect("~/main.aspx);
use this javascript on your main page which disables history of browser 在您的主页上使用此javascript会禁用浏览器的历史记录
<script type = "text/javascript" >
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
</script>
只需向Page_Load()添加一个行代码:
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.