在asp.net中使用模式dialog时,你会发现每次打开的页面都是相同的内容,页面内容并没有刷新,这是缓存的原因造成的,解决方法如下:
ASP.NET清除页面缓存
(1) Response.Buffer = true;
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "No-Cache");
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "No-Cache");
(2) HTML方法
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
(3) 重新调用原页面的时候在给页面传一个参数: href="****.ASPX?random()"
文章来源:http://www.nanmu.net/keli/blog/Lists/Posts/Post.aspx?List=00b35278%2D18ba%2D423b%2Da460%2Dacba809f633d&ID=80
文章来源:http://www.nanmu.net/keli/blog/Lists/Posts/Post.aspx?List=00b35278%2D18ba%2D423b%2Da460%2Dacba809f633d&ID=80