2008-08-31 72 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"); 
相关问题