ddgjgj Ответов: 0

Outputcacheattribute для дочерних действий поддерживает только продолжительность


I am very new to caching , so i added this into filter config :

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());


        filters.Add(new OutputCacheAttribute() { Duration = 3600, VaryByParam = "*", Location = System.Web.UI.OutputCacheLocation.Server });



    }


But i am getting this error ,for partial views, can anyone help me with that ?! OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values. Please do not set CacheProfile, Location, NoStore, SqlDependency, VaryByContentEncoding, or VaryByHeader values for child actions.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



Exception Details: System.InvalidOperationException: OutputCacheAttribute for child actions only supports Duration, VaryByCustom, and VaryByParam values. Please do not set CacheProfile, Location, NoStore, SqlDependency, VaryByContentEncoding, or VaryByHeader values for child actions.



Source Error: 

Line 9:  
Line 10: 
Line 11:     var s = Html.Action("Test").ToString();
Line 12: 


Что я уже пробовал:

------------------------------------------

0 Ответов