3 回答

TA貢獻(xiàn)1921條經(jīng)驗(yàn) 獲得超9個(gè)贊
嘗試這個(gè)
var urlToRemove = Url.Action("AjaxHtmlOutputMethod", "Controller");
HttpResponse.RemoveOutputCacheItem(urlToRemove);
更新:
var requestContext = new System.Web.Routing.RequestContext(
new HttpContextWrapper(System.Web.HttpContext.Current),
new System.Web.Routing.RouteData());
var Url = new System.Web.Mvc.UrlHelper(requestContext);
更新:
嘗試這個(gè):
[OutputCache(Location= System.Web.UI.OutputCacheLocation.Server, Duration=3600,VaryByParam="param1;param2")]
否則,緩存刪除將無(wú)法進(jìn)行,因?yàn)槟褜TML輸出緩存在用戶計(jì)算機(jī)上
- 3 回答
- 0 關(guān)注
- 605 瀏覽
添加回答
舉報(bào)