2
我在ASP.NET頁面上使用OutputCache。我在我的Page_Load中以編程方式將其設置爲這樣:如何禁用ASP.Net頁面上的一個UserControl的OutputCache?
Response.AddFileDependency(cachefilepath);
Response.Cache.SetExpires(DateTime.Now.AddHours(12));
Response.Cache.SetCacheability(HttpCacheability.Server);
Response.Cache.SetValidUntilExpires(true);
Response.Cache.SetSlidingExpiration(false);
Response.Cache.VaryByParams["*"] = true;
現在頁面將被緩存並且工作正常。但我有一個不應該被緩存的頁面上的UserControl。雖然整個頁面正在緩存,但可以禁用此用戶控件的緩存嗎?
的原因是,該用戶控件的輸出有兩種狀態,因此可以根據自己的行爲每個客戶不同的...