The URL Routing engine introduced with ASP.NET 3.5 SP1
provides a powerful way to handle incoming URLs. Typically you write code
as part of application startup to register/map URLs that match a specific URL
format to code handlers.
Below is an example of how you can use ASP.NET MVC today to
map the /products/software URL to a controller class called “Products” that has
an action method named “Browse”:
Figure 1
The first “products-browse” parameter to the MapRoute()
helper method above is a friendly name for the route. The second
“products/{category}” parameter is the URL filter that matches the
/products/software URL – and which treats the second segment of the URL as a
parameter value called “category”. This parameter will then be passed to
the ProductsController’s Browse() action method to process.