Dissecting ASP.NET Routing
The ASP.NET Routing framework allows developers to decouple the URL of a resource from the physical file on the web server. Specifically, the developer defines routing rules,which map URL patterns to a class or ASP.NET page that generates the content.
For instance, you could create a URL pattern of the form Categories/CategoryName and map it to the ASP.NET page ShowCategoryDetails.aspx; the ShowCategoryDetails.aspx page would display details about the category CategoryName.With such a mapping, users could view category about the Beverages category by visiting www.yoursite.com/Categories/Beverages.
In short, ASP.NET Routing allowsfor readable, SEO-friendly URLs. ASP.NET Routing was first introduced in ASP.NET 3.5 SP1 and was enhanced further in ASP.NET 4.0. ASP.NET Routing is a key component of ASP.NETMVC, but can also be used with Web Forms.
This article aims to explore ASP.NET Routing in greater depth. We’ll explore how ASP.NET Routing works underneath the covers to decode a URL pattern and hand it off the theappropriate class or ASP.NET page.
View the Original article