Chapter 9. Controlling URLs with routing

 

This chapter covers

  • Routing as a solution to URL issues
  • Designing a URL schema
  • Using routing in ASP.NET MVC
  • Using routing with ASP.NET Web Forms
  • Debugging and testing routes

So far in this book, we’ve used the default routing configuration that comes with any new ASP.NET MVC project. In this chapter, we’ll cover the routing system in depth and learn how to create custom routes for applications to ensure that URLs are both user-friendly and accessible to search engines.

Routing is all about the URL and how you use it as an external input to the applications you build. When working with other web development tools, such as PHP, Web Forms, or even Classic ASP, the URL typically corresponds to a physical file on disk. A URL of http://example.com/Products.aspx would cause the execution of a file named Products.aspx that would be responsible for handling the request.

ASP.NET MVC decouples the URL from a physical file by making use of URL routing to provide a way to map URLs without extensions to controller actions in a way that gives the developer complete control over the URL schema.

9.1. Introducing URL routing

 
 

9.2. Designing a URL schema

 
 
 

9.3. Implementing routes in ASP.NET MVC

 
 

9.4. Using the routing system to generate URLs

 
 

9.5. Routing with ASP.NET Web Forms

 
 

9.6. Debugging routes

 
 

9.7. Testing route behavior

 
 
 

9.8. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest