由于不存在能够完全禁用后退按钮,所以
最好的方案应该是:混合运用客户端脚本和服务器端脚本。
<html>
<head>
<meta http-equiv="Expires"CONTENT="0">
<meta http-equiv="Cache-Control"CONTENT="no-cache">
<meta http-equiv="Pragma"CONTENT="no-cache">
<html>
<head>
<meta http-equiv="Expires"CONTENT="0">
<meta http-equiv="Cache-Control"CONTENT="no-cache">
<meta http-equiv="Pragma"CONTENT="no-cache">
<script type="text/javascript">javascript:window.history.forward(1);</script>
ASP.Net 后台代码 :
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();