Solved Changing sitemaps on the fly

Posted on 2011-10-27
Last Modified: 2012-08-13
OK, I see this question has been asked and sometimes answered but still can't figure out what I'm doing wrong.  I have a few different sitemaps declared.  When a user logs in, the program gathers thier security level and assigns a sitemap based on who they are.  Can't get it to work, please help!

Here's the code:
In Site:Master
       <asp:SiteMapDataSource ID="SiteMapPublic" runat="server" />
       <asp:Menu runat="server" ID="MainMenu" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" StaticDisplayLevels="2"
            Orientation="Horizontal" DataSourceID="SiteMapPublic"/>

In Web.Config file:
   <siteMap defaultProvider="SiteMapQDSAdmin" enabled="true">
        <add name="SiteMapPublic" type="System.Web.XmlSiteMapProvider" siteMapFile="~/App_Data/Public.sitemap" />
        <add name="SiteMapQDSAdmin" type="System.Web.XmlSiteMapProvider" siteMapFile="~/App_Data/QDSAdmin.sitemap" />
        <add name="SiteMapQDSViewer" type="System.Web.XmlSiteMapProvider" siteMapFile="~/App_Data/QDSViewer.sitemap" />
        <add name="SiteMapVendor" type="System.Web.XmlSiteMapProvider" siteMapFile="~/App_Data/Vendor.sitemap" />          
        <add name="SiteMapClient" type="System.Web.XmlSiteMapProvider" siteMapFile="~/App_Data/Client.sitemap" />
Question by:QualityData
    1 Comment
    LVL 16

    Accepted Solution

    Your question statement:

    When a user logs in, the program gathers thier security level and assigns a sitemap based on who they are.  

    So are you trying to set some sitemap to SiteMapDataSource at runtime?

    If yes, in that case you can use: (Check more


    Open in new window

    You can also look at link:

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 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

    17 Experts available now in Live!

    Get 1:1 Help Now