2008-08-31 27 views

回答

9

這應該做的伎倆:

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 

Dim path As String 
path="/AbosoluteVirtualPath/OutputCached.aspx" 
HttpResponse.RemoveOutputCacheItem(path) 

End Sub 
+5

此答案實際上並未清除原始問題中指定的「整個網站」緩存。 – 2014-02-17 10:09:55

0

添加以下代碼到控制器或頁面代碼:

HttpContext.Cache.Insert("Page", 1); 
Response.AddCacheItemDependency("Page"); 

要清除輸出cachne控制器中使用以下命令:

HttpContext.Cache.Remove("Page"); 
相關問題