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

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