Posted on: 4/4/2011 7:11:33 AM | Views : 742

Hi Guys,
I've gotten started with the setting up of my routes and it works well when I know I'm working with 2 levels depth, where the 1st level is static and known, where as the 2nd level is unknown.
The issue is that I have no idea how deep my website will eventually be, so I don't want to hard code static parts of urls now and have to do it again later.
So the question is, how can I set up routing where the URL segments are unknown and I don't know how deep they will be, for example:
mysite.com/{unknownURLSegment1}/{unknownURLSegment2}/{unknownURLSegment3}
 
I'm storing each URL segment/pagename in a database so it is easy enough to query against.
Below is an example of a route I am already successfully using:
routes.MapPageRoute("articleTemplate", "articles/{pageName}", "~/page-templates/article-template.aspx")
"articles" is the known, static portion of the ...

Go to the complete details ...