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