Understanding Results from Action Methods

One of the most important aspects of an action method is its result. This instructs the MVC framework as to the next step to take in processing the request. The simplest kind of instruction is to do nothing, which we can express by defining an action method that has no return value, using the C# void keyword, as shown in Listing 28-5.

Listing 28-5. Defining an action method that defines no next step

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

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.