Routing optional parameters with dashes in MVC
- by Géza
I've made an routing definition like this:
routes.MapRoute("ProductSearch", "Search-{MainGroup}-{SubGroup}-{ItemType}",
new {
controller = "Product",
action = "Search",
MainGroup = "", SubGroup = "", ItemWebType = ""});
It is not working if the parameters are empty.
Actually it resolves the url, so Url.Action method resolves the…