Understanding Model Binding

Model binding is the process of creating .NET objects using the data sent by the browser in an HTP request. I touched on model binding in Chapter 23, but let's recap that example to set a foundation for this chapter, going back and resetting the code for our RegistrationController class. Listing 29-1 shows the contents of the controller.

Listing 29-1. The basic RegistrationController class

using System.Web.Mvc; using EventRegistration.Models.Domain; using EventRegistration.Models.Domain.Repository; namespace EventRegistration.Controllers {     public class RegistrationController : Controller {         private IRepository repository;         public RegistrationController(IRepository repo) {             repository ...

Get Applied ASP.NET 4 in Context now with O’Reilly online learning.

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