【发布时间】:2011-01-20 17:35:09
【问题描述】:
如何在 ASp.NET MVC 3 中缓存 PartialViews 的输出?我知道我可以使用 [OutputCache] 属性来装饰动作,但我只想将 @OutputCache 包含在 PartialView 中,如下所示:
@OutputCacheAttribute
@model MvcApplication1.Models.someViewmodel
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@Html.Partial("_MyPartialView")
【问题讨论】:
标签: asp.net-mvc