Alternate SiteMapProviders and the SiteMapDataSource

I have a scenario where I think I've found a bug in the SiteMap API in ASP.NET 2.0. The scenario is this:

  1. Create two separate .sitemap files in your application.
  2. Create two SiteMapProvider references in the web.config file. Give them unique names and make one the default.
  3. Create a new webpage. Drag a SiteMapDataSource control onto the page, and specify the name of the non-default SiteMapProvider in the "SiteMapProvider" property.
  4. Drag a Menu control onto the page, and configure it to use the SiteMapDataSource control on the page.

There are two things that I see happening, and I'm wondering ig anyone else sees this:

  1. At Design-time, the Menu will bring up data from the default provider, regardless of the provider you specify.
  2. At runtime, the Menu will not populate with any data.

Is this an issue just with my setup, or are other people seeing this? I dug through the code in Reflector, and I think I found a bug, but I want to make sure I'm not the only one experienceing this first.

5 Comments

  • I have done exactly the same in developing this site - www.rxforit.com and have had no problems. 3 sitemaps and 3 SiteMapProvider references.

    The only thing different from your scenario is that I have NOT specified a default SiteMapProvider in the web.config.

  • I've used two, with one as default, and I don't get the run-time issues. I can't comment on design time, though, because I've never actually tried using the design time experience (still not wanting to get burned after my VS 2003 experiences - I'm an HTML kind of guy)

  • I try it and works for me. Just thought you wanted to know.

    Al

    PS Love your blog

  • I am seeing this exact same thing occuring in my code. No matter what I set the sitemapprovider to, it always uses the default. I was wondering if you figured out a way around this problem. I have been scouring the net, and no one seems to be discussing it.

  • Dan:
    Well, I think it's interesting, because it doesn't follow the Provider Model Specifications. For every other PM API, you MUST specify a default, or the API throws an exception that stops your application.

    Albert:
    Thanks a bunch :)

Comments have been disabled for this content.