关于模式窗体的缓存问题的解决方案

from:http://hi.baidu.com/cnhbhg/blog/item/597f861bfb926ad1ad6e75a8.html

模式窗体,是通过querstring传值的,当编辑某条信息的时候,遇到弹出的模式窗体老是调用缓存的值的问题,最终还是找到了解决方案,现总结如下:
html:
在<head></head>之间加上:
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
ASP:
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
%>

//asp.net中,在窗体的PAGE_LOAD事件中加上Response.CacheControl = "no-cache";
如下:
protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        if (!Page.IsPostBack)
        {
            this.d1.Value = DateTime.Now.ToString();
        }
    }

PHP:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
JSP:
response.setHeader("Pragma","No-Cache");
response.setHeader("Cache-Control","No-Cache");
response.setDateHeader("Expires", 0);

转载于:https://www.cnblogs.com/baishahe/archive/2008/02/24/1079389.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值