views:

27

answers:

1

Hi Is it possible to create a route, who accepts X number of Categories/subCategories

mysite.com/CategoryName//ProductID/ProductName
mysite.com/CategoryName/Sub1CategoryName/ProductID/ProductName
mysite.com/CategoryName/Sub1CategoryName/Sub2Category/ProductID/ProductName

Of cource I could create a route for each possible combination, but I really don't know how deep my categories tree would be.

Maybe something with a regular expression.

+1  A: 

Define your own route handler, similar to what I posted in this answer:

http://stackoverflow.com/questions/3874625/mvc-route-with-array-of-homogeneous-parameters/3875438#3875438

eglasius
Thanks alot eglasius it exactly what I was looking for :-)
gulbaek