六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 138|回复: 0

C#清除页面缓存

[复制链接]

升级  0.67%

58

主题

58

主题

58

主题

举人

Rank: 3Rank: 3

积分
202
 楼主| 发表于 2013-2-7 20:21:41 | 显示全部楼层 |阅读模式
private void SetPageNoCache()        {            Response.Buffer = true;            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);            Response.Expires = 0;            Response.CacheControl = "no-cache";            Response.AddHeader("Pragma", "No-Cache");        }    (1)   Response.Buffer = true;            Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);            Response.Expires = 0;            Response.CacheControl = "no-cache";            Response.AddHeader("Pragma", "No-Cache");    (2) HTML方法                <meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">    (3) 重新调用原页面的时候在给页面传一个参数:    href="****.ASPX?random()"
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表