Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

registering multiple sitemaps

Posted on 2006-07-22
4
Medium Priority
?
376 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-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

722 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