当前位置:编程学习 > C#/ASP.NET >>

怎么禁用浏览器后退按钮?

在ASP.NET里,怎么禁用浏览器后退按钮? --------------------编程问答-------------------- 浏览器后退按钮不能禁用. --------------------编程问答-------------------- 那个是浏览器自己的。没办法操作。只能在自己页面做其他限制 --------------------编程问答-------------------- 那该怎么限制啊?我是新手,帮帮忙 --------------------编程问答--------------------


<% 
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
%> 


--------------------编程问答-------------------- 清除缓存!!! --------------------编程问答-------------------- 禁用浏览的后退按钮 --------------------编程问答--------------------
引用 3 楼 julie886 的回复:
那该怎么限制啊?我是新手,帮帮忙


你需要达到什么效果? --------------------编程问答--------------------
引用 4 楼 porschev 的回复:
HTML code


<% 
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
%>

穿上放在Headr里可以实现
或在页面上写个histroy.go(1)
或 window.location.replace("path"); --------------------编程问答--------------------
引用 8 楼 begintransaction 的回复:
引用 4 楼 porschev 的回复:
HTML code


<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>

穿上放在Headr里可以实现
或在页面上写个histroy.go……


+1 --------------------编程问答-------------------- 就是不让缓存了,都是比较被动的做法.
--------------------编程问答-------------------- <body onload ='window.history.forward(1)'>

试试,应该可以 --------------------编程问答-------------------- 跳转到新页面时用下面的方法:

Response.Write("<script>location.replace('新页面.aspx');history.back();location.replace('新页面.aspx');</script>");
--------------------编程问答-------------------- 比如我登陆一个页面,提交一些数据,跳转的另外一个页面,当点击浏览器后退按钮时会跳回到原来的页面,我不想让它调回去,让它跳转到“Default.aspx”页面,这怎么做啊? --------------------编程问答--------------------  HttpContext.Current.Response.Write("<script language=JavaScript>alert('您已经成功录入!);window.location.href='./pdf/TJAM051405.pdf'+ '?t=' + Math.random();   </script>");
我是这么弄的,是不能返回上一页但是不能返回到首页了。 --------------------编程问答-------------------- --------------------编程问答-------------------- Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);  
Response.Expires = 0;  
Response.Buffer = true;  
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);  
Response.AddHeader("pragma", "no-cache");  
Response.CacheControl = "no-cache";  
Response.Redirect("a.aspx");  
--------------------编程问答-------------------- 用js

window.location.replace('Login.aspx') --------------------编程问答-------------------- <body onload ='window.history.forward(1)'>
可以试试
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,