asp.net mvc - Is there a way to get a PartialView HTML content in the controller? -


i have partial view controller outputcache on need cache element.

then need render partialview in every page, first need string replacement.

so question is, howdo partial view in controller can manipulate content , string replacement before returning view?

thanks

no, don't this. controller should not render view, that's job of templating engine.

pass "replacement" values model partialview.

public actionresult someaction() {   somemodelmodel = new somemodel(); // model   return partialview(model); // partial view model } 

and partial view:

@model somemodel  <div>replace values @model.value instead of string.replace().</div> 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -