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


    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);
  • 相关阅读:
    oracle实现自增id
    一些.NET 项目中经常使用的类库
    文件读取是判断是否读取到末尾
    文件操作
    第一个html文件
    HTML标签(持续更新)
    配置tomcat
    判断一个String中是否有指定字符或字符串
    去掉字符串中的某个字符
    把一个activity作为弹窗
  • 原文地址:https://www.cnblogs.com/baishahe/p/1079389.html
Copyright © 2020-2023  润新知