I have a scenario where i want to apply cache on a user control in asp.net mvc 2.
I have applied
<%@ OutputCache Duration="3600" VaryByParam="none" %>
but user control output is not cached. I read on a blog that
Html.RenderPartial method ignores any OutputCache directives on
the view user control
So, My question is how to apply cache on user control in Asp.Net MVC 2. Im rendering my user control in a MasterPage like this
<% Html.RenderPartial("Widgets/Modulename"); %>
Second Part of Question
Can i apply caching on a Helper Method in Asp.Net MVC 2 like this
[OutputCache(Duration = 3600, VaryByParam = "SidebarDetailsId")]
I found my answer on Phil Haack blog.