title: How to configure multiple sitemaps with asp:menu control
body: <p>It's driving me nuts. I've searched and tried and searched and tried ... now I ask for your help!</p>
  
  <p>I have an asp:menu control that uses a sitemap. Once the user is authenticated, I want to dynamically change the site map from code behind (c#). Here's the pertinent lines of code:</p>
  
  <pre><code>Site.Master:
  
  &lt;asp:Menu ID="aspMenu" runat="server" StaticDisplayLevels="1" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"&gt;
  
  &lt;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False"
  StartFromCurrentNode="False" StartingNodeOffset="0" /&gt;
  
  web.config:
  
    &lt;siteMap defaultProvider="WebSitemap" &gt;
      &lt;providers&gt;
        &lt;add name="WebSitemap" type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap"/&gt;
        &lt;add name="MemberSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="Member.sitemap"/&gt;
      &lt;/providers&gt;
    &lt;/siteMap&gt;
  
  Site.Master.cs:
  
      protected override void OnPreRender(System.EventArgs e)
      {
          if (Request.IsAuthenticated)
          {
              SiteMapDataSource1.SiteMapProvider = "MemberSitemap";
  
          }
      }
  </code></pre>
  
  <p>After a successful build (VS 2010, 4.0 framework) I get the following error after a login:</p>
  
  <p>Server Error in '/' Application.
  The SiteMapProvider 'MemberSitemap' cannot be found. </p>
  
  <p>What am I doing wrong? Thanks .... Bob</p>