我看到的所有关于甜甜圈缓存的例子都像这样:
<%= Html.Substitute( c => DateTime.Now.ToString() )%>
如果我只想要日期,那很好,但还有哪些选项?
我知道有一个委托'MvcSubstitutionCallback',它具有以下签名:
public delegate string MvcSubstitutionCallback(HttpContextBase httpContext);
但是RenderAction
和RenderPartial
返回void,所以我不能仅仅从委托方法中返回它们。我该如何在更复杂的情况下有效地使用这个回调函数。