Creating the Action Method
Before we can start, we need to create a new action method that we'll work with as we investigate views. We are going to build on the example we have used in the past few chapters, and Listing 25-1 shows the RegistrationController
class with a new action method.
Listing 25-1. Adding a new action method to the RegistrationController class
using System;
using System.Linq;
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 = repo;
}
Get Applied ASP.NET 4 in Context 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.