Hi im having a problem to figure this out, i am literally going nuts. I got a scenario like this. Category , Category-SubCategory, Category-SubCategory-SubSubCategory
I cant for the life of me figure out this route. My last and current is like this
routes.MapRoute(
"Navigation",
"Navigation/{nav}/{sub}/{subsub}/{id}",
new { controller = "Navigation", action = "Site", nav = UrlParameter.Optional, sub = UrlParameter.Optional, subsub = UrlParameter.Optional, id = UrlParameter.Optional }
);
I figure like this that UrlParameter.Optional would skip the sub or the subsub but instead it puts system.UrlParameter.Optional as a parameter there. Any ideas on how this can be handled?
EDIT 1:
so far i limited the site with 2 sub categories and did 3 routes and 3 actionresults. not a pretty solution but works for now
Cut it to one route by cheating a bit.
and i write all the categories, subcategories in the nav like
i figure the {nav} dont really got any function here except to show the category path and in case i need to break it out ill use the string spliter.