O'Reilly logo

Programming ASP.NET MVC 4 by Hrusikesh Panda, Jess Chadwick, Todd Snyder

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

Chapter 14. Advanced Routing

The first chapter of this book gave you a brief introduction to the fundamentals of ASP.NET MVC routing. That chapter shows the default route that Visual Studio generates for you when you create a new ASP.NET MVC project, and it talks about how the routing framework uses that route to determine which controller and action should be used to execute each request.

For the most part, you will not need to worry about anything more advanced than the default route that Visual Studio initially generates. The default route follows the standard ASP.NET MVC convention and allows you to create new controllers and actions without having to worry much about how the routing engine will locate them. Only if your application moves beyond these common scenarios will you have to gain a better understanding of ASP.NET MVC’s powerful routing framework in order to operate outside of the default URL pattern and the default values.

In this chapter, we will go beyond ASP.NET MVC’s conventional route and take a deeper look at the powerful routing engine that drives ASP.NET MVC applications. We’ll start with a discussion about why URLs are so important to a web application’s user experience and how your application’s URLs can affect how your site ranks in search engine results. Then we’ll dive into creating more advanced routes by exploring different URL patterns. We’ll also consider defining constraints on those routes and look at a useful tool, called Glimps, for helping to debug ...

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