Click here to Skip to main content
14,866,383 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there everyone, I have a small problem,

Im creating a web app that uses master pages. the application has a set of pages that clients can access and they inherit from a Site.master. It also has a set of pages that employees can access which in turn inherit from Admin.master.

I have employed 2 sitemap files: Admin.sitemap and Web.sitemap. I have also used bread crumb controls in each master:

C#
<
<asp:SiteMapDataSource ID="smDS" ShowStartingNode="true" SiteMapProvider="adminSmProvider"  runat="server" />
                <asp:SiteMapPath ID="breadCrumb" runat="server" Font-Names="Verdana" 
            Font-Size="0.8em" PathSeparator=" : "  >
                    <CurrentNodeStyle ForeColor="#333333" />
                    <NodeStyle Font-Bold="True" ForeColor="#284E98" />
                    <PathSeparatorStyle Font-Bold="True" ForeColor="#507CD1" />
                    <RootNodeStyle Font-Bold="True" ForeColor="#507CD1" />
        </asp:SiteMapPath>/pre>

and in site.master:

<pre lang="c#"><asp:SiteMapDataSource ID="smDS" ShowStartingNode="true" SiteMapProvider="smProvider"  runat="server" />
                <asp:SiteMapPath ID="breadCrumb" runat="server" Font-Names="Verdana" 
            Font-Size="0.8em" PathSeparator=" : "  >
                    <CurrentNodeStyle ForeColor="#333333" />
                    <NodeStyle Font-Bold="True" ForeColor="#284E98" />
                    <PathSeparatorStyle Font-Bold="True" ForeColor="#507CD1" />
                    <RootNodeStyle Font-Bold="True" ForeColor="#507CD1" />
        </asp:SiteMapPath>


I have also placed thier providers in the web.config

XML
<system.web>
  <siteMap>
    <providers>
      <add name="adminSmProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Admin.sitemap"/>
      <add name="smProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/>
    </providers>


Now my issue is that while the breadcrumbs display in the pages that inherit from Site.master, it does not work on those which inherit from Admin.master. However I do not get any errors when I debug..

Any Ideas?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900