SiteMapDataSource not recognizing sitemap provider

J

jmorgret

In my application I am using the WebControls Menu and SiteMapDataSource.
Everything works fine until...

I try to add the sitemap provider to the web.config. If I don't add a
provider the SiteMapDataSource finds the web.sitemap on it's own and
works fine but if I add it as a provider in the web.config then it
doesn't load anything into the menu.

My ultimate objective is to have two sitemaps but even just adding a
second sitemap to the project seems to mess it up. Here is my code.

Web.config:
<siteMap>
<providers>
<add siteMapFile="web.sitemap" name="AspNetXmlSiteMapProvider"
securityTrimmingEnabled="true"
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
<add siteMapFile="short.sitemap" name="ShortSiteMapProvider"
securityTrimmingEnabled="true"
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</siteMap>


aspx page:

<asp:SiteMapDataSource ID="SiteMapDataSource1"
runat="server" ShowStartingNode="False"
SiteMapProvider="ShortSiteMapProvider" />

I have tried this with just one sitemap (web.sitemap) and I still could
not get it to work.

Any suggestions? Thanks.
 
J

jmorgret

I was able to fix this.

<siteMap defaultProvider="AspNetXmlSiteMapProvider">
<providers>

<add siteMapFile="short.sitemap" name="ShortSiteMapProvider"
type="System.Web.XmlSiteMapProvider" />
</providers>
</siteMap>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top