Chapter 17. Model Binding

Model binding is the process of creating .NET objects using the data sent by the browser in an HTTP request. We have been relying on the model binding process each time we have defined an action method that takes a parameter—the parameter objects are created by model binding. In this chapter, we'll show you how the model binding system works and demonstrate the techniques required to customize it for advanced use.

Understanding Model Binding

Imagine that we have defined an action method in a controller as shown in Listing 17-1.

Example 17.1. A Simple Action Method

using System; using System.Web.Mvc; using MvcApp.Models; namespace MvcApp.Controllers { public class HomeController : Controller { public ViewResult Person(int ...

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

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