asp.net mvc 清除視圖緩存

asp.net mvc 清除視圖緩存,消除緩存方法

public ActionResult SearchCommunityPopulation()
{
        //禁止頁面被緩存
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.Today.AddYears(-2));
        return PartialView("Index", 數據源);
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章