本文介绍了在Internet Explorer或其他浏览器中禁用后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个aspx页面,添加一些细节并重定向到另一个页面,但当我点击Internet Explorer中的后退按钮它显示添加的细节,所以我想禁用该后退按钮或当我点击互联网上的后退按钮然后它应该保留在该页面上
i have an aspx page that add some details and redirect to another page but when i click on back button in internet explorer it shows that added detail, so i want to disable that back button OR when i click on back button in internet explorer then it should be remain on that page
推荐答案
protected void Page_Load(object sender, EventArgs e)
{
Context.Request.Browser.Adapters.Clear();
Response.Cache.SetExpires(DateTime.Parse(DateTime.Now.ToString()));
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
}
在这两个页面中添加它将清除缓存。点击后退按钮,您将获得新页面服务器。
add this in your both the pages it will clear the cache.And by clicking on the back button you will get fresh page from the server.
这篇关于在Internet Explorer或其他浏览器中禁用后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!