O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required