Hi I would like to use asp.net MVCSiteMapProvider v4 with 2 different sitemaps, one for the main site and one for the admin area. I have done some search and I have found that you need insert it on web.config:
<siteMap defaultProvider="AppSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="AppSiteMapProvider" type="MvcSiteMapProvider.DefaultSiteMapProvider,
MvcSiteMapProvider" siteMapFile="~/Mvc2.sitemap"
securityTrimmingEnabled="true" cacheDuration="5"
enableLocalization="true" scanAssembliesForSiteMapNodes="true"
includeAssembliesForScan="" excludeAssembliesForScan=""
attributesToIgnore="visibility"
nodeKeyGenerator="MvcSiteMapProvider.DefaultNodeKeyGenerator,
MvcSiteMapProvider"
controllerTypeResolver="MvcSiteMapProvider.DefaultControllerTypeResolver,
MvcSiteMapProvider"
actionMethodParameterResolver="MvcSiteMapProvider.DefaultActionMethodParameterResolver,
MvcSiteMapProvider" aclModule="MvcSiteMapProvider.DefaultAclModule,
MvcSiteMapProvider"
siteMapNodeUrlResolver="MvcSiteMapProvider.DefaultSiteMapNodeUrlResolver, MvcSiteMapProvider"
siteMapNodeVisibilityProvider="MvcSiteMapProvider.DefaultSiteMapNodeVisibilityProvider, MvcSiteMapProvider"
siteMapProviderEventHandler="MvcSiteMapProvider.DefaultSiteMapProviderEventHandler, MvcSiteMapProvider" />
<add name="AdminSiteMapProvider" type="MvcSiteMapProvider.DefaultSiteMapProvider,
MvcSiteMapProvider" siteMapFile="~/Areas/Admin/Mvc.Sitemap"
securityTrimmingEnabled="true" cacheDuration="5" enableLocalization="true"
scanAssembliesForSiteMapNodes="true" includeAssembliesForScan=""
excludeAssembliesForScan="" attributesToIgnore="visibility"
nodeKeyGenerator="MvcSiteMapProvider.DefaultNodeKeyGenerator, MvcSiteMapProvider"
controllerTypeResolver="MvcSiteMapProvider.DefaultControllerTypeResolver, MvcSiteMapProvider"
actionMethodParameterResolver="MvcSiteMapProvider.DefaultActionMethodParameterResolver,
MvcSiteMapProvider" aclModule="MvcSiteMapProvider.DefaultAclModule, MvcSiteMapProvider"
siteMapNodeUrlResolver="MvcSiteMapProvider.DefaultSiteMapNodeUrlResolver, MvcSiteMapProvider"
siteMapNodeVisibilityProvider="MvcSiteMapProvider.DefaultSiteMapNodeVisibilityProvider, MvcSiteMapProvider"
siteMapProviderEventHandler="MvcSiteMapProvider.DefaultSiteMapProviderEventHandler, MvcSiteMapProvider" />
</providers>
</siteMap>
and then using
@Html.MvcSiteMap("AdminSiteMapProvider").Menu()
But it is not working. Is someone having the same problem??????? Btw the error is:
Could not find file 'P:\MVCTest\MvcSite1\MvcSite1\Mvc.sitemap'.
It is like they are just ignoring the web.config