So I have this route mapped:
routes.MapRoute(
"Solutions",
"{lang}/Solutions/{controller}/{action}",
new { lang="en-US", controller = "WhatWeDo", action = "Index"}
);
When I go to”
/en-GB/Solutions/SolutionA/Index/
It routes just fine, but
/en-GB/Solutions/SolutionA/
Doesn’t route at all. However, if I take out the lang parameter, so the route looks like
routes.MapRoute(
"Solutions",
"Solutions/{controller}/{action}",
new { controller = "WhatWeDo", action = "Index"}
);
and I go to
/Solutions/SolutionA/
It routes just fine. Any ideas? I’d like to not have to specify the default action all the time for this route. Thanks.
What order are you defining your routes in global.asax, this could have something to with the issue but my initial guess is that it’s matching the default route as such
What you might be able to do is setup some sort of regular expression matching on your routes to exclude your language from the “default” route? Try this link for more information about using regex for route filtering http://www.iridescence.no/post/Defining-Routes-using-Regular-Expressions-in-ASPNET-MVC.aspx