|
ASP技巧:禁用页面缓存的五种方法(2) response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %> </head>
5、window.location.replace("WebForm1.aspx"); 参数就是你要覆盖的页面,replace的原理就是用当前页面替换掉replace参数指定的页面。 这样可以防止用户点击back键。使用的是Javascript脚本,举例如下:
a.html
<html> <head> <title>a</title> <script language="javascript"> function jump(){ window.location.replace("b.html"); } </script> </head> <body> <a href="javascript:jump()">b</a> </body> </html>
b.html
<html> <head> <title>b</title> <script language="javascript"> function jump(){ window.location.replace("a.html"); }
|