I have a WebForms application and was thinking about using routing for friendlier URLs. However, during my tinkering I discovered that the query string parameters which are a part of a route are no longer available via Request.QueryString (which makes sense). Ideally, I'd like to still be able to have those values available from the QueryString collection so I don't have to update the hundreds of pages using the query string values to use the route data values instead. For example, so I don't have to replace this:
var foo = Request.QueryString["foo"];
with this:
var foo = RouteData.Values["foo"];
I was thinking of using URL Rewrite instead but I'd eventually like to take advantage of named routes for redirection and hyperlinks.
Is there a way to use routing without updating every single page to use the RouteData collection instead of the QueryString collection?
in global.asax
in products.aspx
in productsdetails.aspx.cs
This is Clean Class