Search code examples
mvcsitemapprovider

MvcSiteMapProvider that supports sub areas


I'm looking for a SiteMap provider for use in an MVC 5 application that can support sub areas.

The folder structure in my project notionally looks something like:

  • Project Root
    • Areas
      • Area A
        • Controllers
        • Models
        • Views
        • Areas
          • Area A1
            • Controllers
            • Models
            • Views

I need an MVC SiteMapProvider that allows me to use controllers located in the A1 directory.

I've played with the MvcSiteMapProvider (https://github.com/maartenba/MvcSiteMapProvider), and it does not seem to support sub areas in the sitemap file. Is anyone aware of a solution for creating breadcrumbs with this type of setup?


Solution

  • Since MVC doesn't support sub-areas without advanced customization, MvcSiteMapProvider does not support them either.

    However, there is a project called MvcCodeRouting that supports multiple levels of controllers as an alternative to MVC areas, and MvcSiteMapProvider has support for it.