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

Using the HTTP Method Selector Attributes

The routing system provides the MVC framework with details of which controller and action are targeted by a requested URL. These are the values assigned to the controller and action routing variables.

The MVC framework can figure out which class corresponds to the requested controller pretty easily (although it does sometimes need some help when areas are used, as I explained in Chapter 27). Working out which method the action corresponds to is more complicated, because C# allows us to create multiple methods of the same name but with different parameter signatures. Listing 28-22 shows a new controller class, called Reports, that I have added to the example project and that contains two methods called ...

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