Solved

registering multiple sitemaps

Posted on 2006-07-22
4
371 Views
Last Modified: 2008-03-10
I am trying to use multiple sitemaps.  I tried adding the following to the web.config file:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ConnectionString" value="Password=xxxxx;Persist Security Info=True;User ID=username;Initial Catalog=DBName;Data Source=SERVERNAME" />
</appSettings>
<system.web>
<siteMap defaultProvider="XmlSiteMapProvider">
<providers>
<add name="TopNavigationBar" type="System.Web.XmlSiteMapProvider" siteMapFile="~/NavigationMenus/TopNavigationBar.sitemap" />
<add name="LeftNavigationBar"type="System.Web.XmlSiteMapProvider" siteMapFile="~/NavigationMenus/LeftNavigationBar.sitemap" />
</providers>
</siteMap>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
</configuration>

But, I recieved the following error: the provider 'XmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

So, the default web.sitemap file in my root directory is no longer recognized.

Where did I go wrong?
0
Comment
Question by:-Dman100-
  • 2
  • 2
4 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17161727
Here is a good article describing multiple SiteMaps:

Examining ASP.NET 2.0's Site Navigation - Part 1
http://aspnet.4guysfromrolla.com/articles/111605-1.aspx

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
  <siteMapNode attributes>
    <siteMapNode attributes>
      <siteMapNode attributes>
      ...
    </siteMapNode>
    <siteMapNode attributes />
    ...    
    <siteMapNode attributes />
  </siteMapNode>
</siteMap>

Bob
0
 

Author Comment

by:-Dman100-
ID: 17161920
Bob,
Thanks for replying to my post.

I was just trying to figure out the cause of the error when adding the code to the web.config file to enable the use of more than one sitemap file.

If I remove the code, the app runs.

I want to use more than one sitemap file and the articles details how to implement multiple site maps by adding the additional providers in the web.config file.

When I added the code, I received the error.  Did I miss something?  Is there a syntax error?
0
 

Author Comment

by:-Dman100-
ID: 17162065
I figured it out....

I needed to change:

<siteMap defaultProvider="XmlSiteMapProvider">

to

<siteMap defaultProvider="AspNetXmlSiteMapProvider">
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17162732
Darn it, I was looking at, and looking at, and I couldn't see that (I hate when that happens!)

Bob
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question