首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

WebForm页面加载后,累次使用清缓存代码,IE无法加载页面

2014-01-03 
WebForm页面加载后,多次使用清缓存代码,IE无法加载页面在Page_Load里使用了如下代码122次后,页面就无法加

WebForm页面加载后,多次使用清缓存代码,IE无法加载页面
在Page_Load里使用了如下代码122次后,页面就无法加载了。而,121次却可以,请高人指点。

HttpContext.Current.Response.Buffer = true;
        HttpContext.Current.Response.Expires = 0;
        HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);   //DateTime.Now.AddDays(-1); 
        HttpContext.Current.Response.AddHeader("pragma", "no-cache");
        HttpContext.Current.Response.AddHeader("cache-control ", "private");
        HttpContext.Current.Response.CacheControl = "no-cache";
        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(true); 

[解决办法]
删掉这些多余的代码,会有什么问题?

热点排行