We are using MvcSiteMapProvider for breadcrumbs and I discovered an issue that I don’t know how to fix. We use a fix so we can display “-” between words instead of “_” in URLs for user experience. Example:
domain.com/page-with-fix
That’s how our URLs display. MvcSiteMapProvider doesn’t see these as pages when you hit that URL because it uses a traditional route set up from my understanding. {Controller} / {Action} So it’s looking for a controller called page-with-fix but in our solution it would be page_with_fix. Is there a way to extend MvcSiteMapProvider so it can use my HyphenatedRouteHandler class?
I found a solution. In the Mvc.sitemap xml file on the nodes you can use a url=”” attribute to fix route changes. Example: url=”page-with-dash” controller=”page_with_dash”