How do I do multipled level routes best in MVC
- by Lilja
I have a site where I would like an URL like:
/Some maincategory name/{id}/Some subcategory name/{id}/Some item name/{id}
I include the IDs of each level since the name is not unique. This is doable but I have to create a new routing for each level. My Html.ActionLink also looks nasty.
Each level has it's own controller since the levels are completely different. The URLs could be something like this:
_/Birds/2/Waders/4/Flamingos/23_
_/Mammals/5/Dogs/23/Longeared/25/Somedog/76_
_/Insects/7/Spiders_
This is just an example and not what I'm going to use. My applications has nothing to do with animals.
Is there a good way of doing this or should I use the standard routing instead?