Question

I am attempting to use the MvcSiteMapProvider with an MVC 4 site, and am having a problem in a section of the site which has (for example) a Project Listing page and child Project Detail page.

When you access the Detail page, the ID of the entity selected from the Listing is specified in URL e.g.: ~/Project/2/Detail

I have not made the Detail page a Dynamic node, as I do not want the Site Map Provider to provide any enhanced functionality. Essentially I want the Site Map Provider to ignore the projectID URL parameter and always just map to the Detail action.

Unfortunately, I am having the following problem:

  • If the app starts with the first request being for the Listing page, then the user can click through to any project and the SiteMap matches the Detail page just fine.
  • If the app starts with a request for the Detail page, then the SiteMap only matches the Detail page if the URL contains the ProjectID of the first request, i.e. if you visit any other Project then the SiteMap currentnode is null.

I have tried to disable caching, enable caching with a long duration, and have even been digging around in the source code with no success. The inconsistent behaviour suggests it is a bug. Any help would be greatly appreciated.

Was it helpful?

Solution

This problem is resolved.

See thread on MvcSiteMapProvider's github at:

https://github.com/maartenba/MvcSiteMapProvider/issues/154

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top