Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

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.

Posted: May 03 2006, 02:26 PM by interscape | with 6 comment(s)
Filed under:

Comments

The CynicalDoctor said:

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.
# May 3, 2006 5:29 PM

Joel Ross said:

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)
# May 4, 2006 7:58 AM

Albert Pascual said:

I try it and works for me. Just thought you wanted to know.
Al
PS Love your blog
# May 22, 2006 1:26 PM

dan said:

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.
# May 31, 2006 11:22 AM

interscape said:

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 :)
# June 9, 2006 11:48 AM

Robert McLaws: FunWithCoding.NET said:

So I&#39;m trying to upgrade a spaghetti-code Classic ASP application to ASP.NET 2.0. I have to maintain

# October 17, 2006 2:23 AM