YoProgramo.NET Blog
Anotaciones de Programador

ASP.NET MVC cache de UserControls

Ayer pude darme cuenta que el método Html.RenderPartial ignora la directiva de OutputCache en los controles de usuario.

Para que el cache funcione hay que insertar el control de usuario de otra manera, como se ve aqui abajo.

<% @ Page Language = "C#" Inherits = "ViewPage<<Joke>IEnumerable>"%> 
<% @ Register Src = "~ /Views/Inicio/Partial.ascx" TagPrefix = "MVC" TagName = "Parcial"%> <MVC: parcial runat = "server" >

Al insertar de este modo si tomara en cuenta la directiva OutputCache en el UserControl.

Fuente: Donut Caching in ASP.NET MVC

October 7, 2009 10:20 by fabianfigueredo
Categorías: ASP.NET | C#

Add comment


(Will show your Gravatar icon)

biuquote
Loading