How to work with other SiteMapProvider?

May 20, 2009 at 1:52 AM

I need to use  Multiple Sitemap Files in my project, So I carried out the following steps to modify the MvcSiteMap.Web project , It doesn't work.

 

 1:  Add the below code to my web.config file within the System.Web tag

    <siteMap defaultProvider="MyXmlSiteMapProvider" enabled="true">

      <providers>

      <add name="MyXmlSiteMapProvider"

  description="SiteMap provider that reads in .sitemap files."

  type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

  siteMapFile="~/Web.sitemap" />

      

<add name="MvcSiteMapProvider"

             type="MvcSiteMap.Core.MvcSiteMapProvider"

             siteMapFile="~/Mvc.sitemap"

             securityTrimmingEnabled="true"

             cacheDuration="10"

             scanAssembliesForSiteMapNodes="true"

             treatAttributesAsRouteValues="true"

             aclModule="MvcSiteMap.Core.DefaultMvcSiteMapAclModule, MvcSiteMap.Core"/>

</providers>

</siteMap>

 

 

 

2:rename Web.sitemap to   Mvc.sitemap

 

3: Add Web.sitemap file with  below code

<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="" title=""  description="">

      <siteMapNode provider="MvcSiteMapProvider" />

    </siteMapNode>

  

</siteMap>


It seems MvcSiteMapProvider's  FindSiteMapNode doesn't work as resoects.