Chapter 16. Model Templates

The HTML helpers that we looked at in the previous chapter, such as Html.CheckBoxFor and Html.TextBoxFor, specify the HTML element required to edit a piece of data. The MVC Framework supports an alternative approach, known as templated view helpers, where we specify which model object or property we want to display or edit and leave the MVC Framework to figure out what HTML elements should be used.

In this chapter, we'll introduce you to the templated view helpers and demonstrate how to fine-tune, customize, and completely replace parts of the model templates system.

Using Templated View Helpers

The idea of the templated view helpers is that they are more flexible. We don't have to worry about specifying the HTML element ...

Get Pro ASP.NET MVC 3 Framework, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.