Here I have:
routes.MapRoute(
"test", // Route name
"DataWarehouse/Distribution/{category}/{serialNo}",
new { controller = "DataWarehouse",
action = "Distribution",
category= UrlParameter.Optional,
serialNo = UrlParameter.Optional }
);
Category and serialNo are both optional params. When the routing is like: DataWarehouse/Distribution/123
, it always treat 123 as the value for category.
My question is how I can make it to know the 1st param could be either category or serialNo, i.e. DataWarehouse/Distribution/{category}
and DataWarehouse/Distribution/{serialNo}
.