Like a โ€œdonut cacheโ€ in ASP.NET MVC for something more than date

All the donut caching examples I've seen are the same:

 <%= Html.Substitute( c => DateTime.Now.ToString() )%>

Thats fine, if I just need a date, but what other options exist?

I know that there is a delegate 'MvcSubstitutionCallback' that has the following signature:

 public delegate string MvcSubstitutionCallback(HttpContextBase httpContext); 

but RenderActionalso RenderPartialreturns void, so I can't just return them from the delegate method. How can I use this callback effectively for more complex situations.

I reviewed Phil Haacked's articles here and here , but none of them do what I want.

+5
source share
4 answers

" " Response.WriteSubstitution. MVC, , System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial Response.Output(HtmlHelper.cs, 277 - RenderPartialInternal) - html .

+3

All Articles