如何在ASp.NET MVC 3中缓存PartialView的输出?我知道可以使用[OutputCache]属性对动作进行装饰,但我想像下面所示将@OutputCache直接包含在PartialView中:
@OutputCacheAttribute
@model MvcApplication1.Models.someViewmodel
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@Html.Partial("_MyPartialView")