Summary

In this chapter, we explored the ASP.NET routing feature and saw how we can use it to create composable URLs for our web applications. We created simple patterns that act as aliases for .aspx web pages, saw how to add variable segments and access their values from inside code-behind classes, and learned how to provide default values and constraints for these variables.

We also saw that some care is required to get routed URLs to work with jQuery. The ASP.NET syntax for referencing URLs is ugly and verbose, and the classes that implement the routing policy do helpful things that conflict with the helpful things that jQuery tries to do. Nonetheless, with a little work we were able to use routed URLs in jQuery data templates and fix the ...

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.