A long time before ASP.NET Routing came along, ASP.NET already offered a similar functionality: it was called URL mapping.
URL mapping allows having virtual URLs that redirect to real ones. For example, you can have all requests for “/Product/IPhone” redirected to “/Product.aspx?ID=10”. This allows two simple things:
- Hiding complexity (the ID parameter, for example);
- Hiding the technology in use (in this case, the .ASPX extension is never seen);
- Redirecting from one page (such as Default.aspx) to another transparently.
You can configure URL mapping by just adding entries to the urlMapping section on Web.config:
And that’s it, no modules or additional configuration.
You can keep using the QueryString collection:
So, as you can see, this is much simpler that ASP.NET Routing and should only be used in very simple scenarios: when you are using a version of ASP.NET prior to 3.5, or you want to configure routes only through the Web.config file.