I have a partial view with a controller with outputCache on as I need to cache this element.
Then I need to render this PartialView in every page, but first I need to do some string replacement.
So my question is, howdo I get a Partial View in a controller so I can manipulate the content and do some string replacement before returning it to the View?
Thanks
No, don’t do this. Your controller should not render your View, that’s the job of the templating engine.
Pass the “replacement” values as a model to your PartialView.
And the Partial View: