2013-02-25 63 views
0

我有一系列這樣的緩存緩存對象HttpRuntime.Cache在Global.asax中總是空

HttpRuntime.Cache.Insert(....) 

我試圖用一個varyByCustom聲明的用戶控件,並使用此緩存的對象返回值global.asax

Public Overrides Function GetVaryByCustomString(context As HttpContext, arg As String) As String 
    If arg = "getCache" Then 
     Return HttpRuntime.Cache.Get("mainMenu_added") 
    End If 
end function 

我每次都得到一個空記錄。

我在其他地方檢查和緩存鍵確實存在,但在Global.asax中似乎無法訪問?

回答

0

哎呀。這是我做錯了事!

我試圖刷新該控件嵌套在其緩存不再另一種控制!

哎呀。這是一個非常煩人的「功能」的asp.net!