CHAPTER 5

image

Views

In Chapter 4 you saw how action methods return an ActionResult. One of the most commonly used types of action results in an ASP.NET MVC application is the ViewResult. When you return a ViewResult from an action method, it indicates that ASP.NET MVC should invoke a view page to render HTML back to the client browser.

You store view pages in the Views directory inside the application. Views often include server-side code to produce the final HTML. When you create a view, you need to specify the view engine that will be used to process server-side code. Out of the box, ASP.NET MVC includes two view engines:

  • ASPX view engine: The ...

Get Beginning ASP.NET MVC 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.