caching - Is Cache Substitution working in ASP.NET MVC 2? -
Stop working from ASP.NET MVC 1 after updating an application from ASP.NET MVC 2 RC cache replacement has given.
This is my job:
[output cache (duration = 30, verrybeparam = "none")) Public Tasks CacheTest 1 () {Return Scene (" "); }
This option is option:
public static object object (this HTML helper HTML, MVCcopybackback CB) {html.ViewContext.HttpContext.Response.WriteSubstitution (C => CB (new HTTP contact using (C)); Return tap; }
And this is my view:
& lt;% @ page language = "c #" inheritance = "system web.mvc viewpage" % & Gt; & Lt ;; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt; Title & gt; CacheTest & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div & gt; Date: & lt;% = DateTime.Now.ToString ()% & gt; Option: & lt;% = Html.Substitute (c = & gt; DateTime.Now.ToString ())% & gt; Response. Whitesubster: <% Response MergeSubstation (C => Datetime. Now.ToString ()); & Gt%; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
The page is cached for one minute and the replacement does not work, it only shows the time when the page was initially presented. It was working in ASP.NET MVC 1.0!
Any thoughts?
Thanks
It is a bit late, but output is available in cache replacement , Which provides support for both MVC 2 and MVC 3.
Comments
Post a Comment