Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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: 


What I have tried:

------------------------------------------
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900