I need the following routes:
example.com/products
Goes to the product category page (e.g. cars, trucks, buses, bicycles)
controller = Products
, action = Categories()
example.com/products?a=1&b=2
refers to the index of all products in a certain category (e.g. Ford, Honda, Chevy)
controller = Products
, action = Index(string a, string b)
Routes differ only by request, and it seems that MVC does not ignore anything after "?". So, of course, only one rule will ever come across - the first.
How can I distinguish between two?
Edit: indicated differently, I want two routes. Is it possible to use a request on a route or is MVC really ignoring it? Is there a way to hack it or use some special routing scheme, just as I can do user binding and user check?
source share