Understanding Routing in the MVC Framework
In an MVC framework application, routes provide the mapping between requested URLs and action methods in a controller. In the examples I have given so far in this part of the book, I have told you to navigate to URLs in the format /<Controller>/<Action>
. In doing this, I relied on the default routing configuration for an MVC framework application.
MVC framework routes are defined in the Global.asax
file, but they use a slightly different format from the ones in Chapter 12. We are going to build on the example that we used in the previous chapter, and Listing 27-1 shows the Global.asax
file from the EventRegistration
project.
Listing 27-1. The Web.config file
using System; using System.Collections.Generic; ...
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.