I’m writing a simple CMS.
I want to be able to load a View, having it included inside a master page, and then scan the HTML so that I can replace some custom tags (like {{blog}} with my own blog output) and then serve it up to the browser.
How can I get access to the HTML from the ViewResult in order to intercept it?
Sounds like you want to write an
ActionFilterAttribute. This attribute has the following methods:ActionResultis rendered.There is an example here which returns either JSON or XML data depending on the ‘Content-type’ header: Create REST API using ASP.NET MVC that speaks both Json and plain Xml