Browsing All Posts filed under » MVC«

Extending ViewResult in MVC 2

April 21, 2011


I recently needed to return JSON and HTML from the same controller method. One way to handle this is to extend¬†ViewResult and create a new Custome result. Here¬†is a good and nearly complete example. There are a couple of extra steps you need to take to get this example working, as follows. 1.) Extend Controller […]