CHAPTER 20
Templated Helper Methods
The HTML helpers that we looked at in the previous chapter, such as Html.CheckBoxFor
and Html.TextBoxFor
generate a specific type of element, which means that we have to decide in advance what kinds of elements should be used to represent model properties and to manually update our views if the type of a property changes.
In this chapter, we demonstrate the templated helper methods, with which we specify the property we want displayed and let the MVC Framework figure out what HTML elements are required. This is a more flexible approach to displaying data to the user, although it requires some initial care and ...
Get Pro ASP.NET MVC 4, Fourth 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.