Solved

registering multiple sitemaps

Posted on 2006-07-22
4
366 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now