views:

129

answers:

3

Hello,

I have a problem

My route have an extra paramater after hierarchical category.

/2009/World/Asia/08/12/bla-bla-bla

asp.net mvc does not support this because my routing should be

{year}/{*category}/{month}/{day}/{name}

i tried use constraint like

year = @"(\d{4})",category = @"((.+)/)+", month = @"(\d{2})", day = @"(\d{2})"

but i cannot find any solution.

Is there any comment?

Thank you

A: 

Add another rule to your routing with the name parameter.

Chuck Conway
+1  A: 

I'm pretty sure that the route handler tokenizes on the slash character so you won't be able to have a category that includes a slash -- though escaping it might work, not sure about that. You might want to format your URL as:

/2009/World+Asia/08/12/bla-bla-bla

This should translate the category as "World Asia".

If that doesn't work then perhaps you need another route that matches on subcategory as well.

{year}/{category}/{subcategory}/{month}/{day}/{name}
tvanfosson
A: 

Thanks for your replies. I'll try your solutions.

Huseyin