I have been benefiting from the advantages of sitemaps for a while now:
- Extrinsic page relationships. Pages are not responsible for defining their own relationships, instead they are supplied by an external provider. This removes a lot of responsibility from the page when it comes to rendering navigation controls. E.g. "Render my children" instead of "I am a product-list page, so I should render a list of products".
- Page relationships can be inferred from anywhere. E.g. Sitemap pages become completely automated, as do breadcrumbs and top-level navigation.
- Generic navigation. Reusable controls can be used to render lists of links to any type of page.
I have, up until now, also been using SiteMapProviders
as a routing mechanism. I've been storing a 'routed URL' and a 'handler URL' into each node's Url and Key properties, respectively. I.e. a request comes in, the FindSiteMapNode method is called, and the request is rewritten to the returned node's key.
This works perfectly, but I am aware times are changing and we now have Routing Tables.
After some research, it appears that relationships between pages cannot be inferred from routes. Ergo: "sitemaps cannot be inferred from a routing table". (Am I right?)
Assuming this statement, how do I keep my wonderful sitemaps and keep with the times? Is there a way of having both without masses of code repetition between the two? What specific gains will I receive from Routing Tables over my current approach?
I have looked at: ASP.NET URL Routing with WebForms - Using the SiteMap, which points to http://chriscavanagh.wordpress.com/2009/05/19/asp-net-webform-routing-with-sitemaps/
However, the solution only allows a 1..1 mapping between nodes and routes, respectively. For example, you cannot have many product nodes point to a single route with this method.