J
Jeff
hey
asp.net 2.0
My problem is that no matter what SiteMapProvider I specify in the code, it
always uses defaultProvider SiteMapProvider. In other words if I make these
changes to the SiteMapDataSource1:
<siteMap defaultProvider="Anonymous">
The menu which is based on this SiteMapProvider get menu items from the
Anoymous SiteMapProvider... But SiteMapDataSource1.SiteMapProvider is set to
"LoggedIn"
<siteMap defaultProvider="LoggedIn">
<providers>
<add name="LoggedIn" type="System.Web.XmlSiteMapProvider"
siteMapFile="LoggedIn.sitemap"/>
<add name="Anonymous" type="System.Web.XmlSiteMapProvider"
siteMapFile="Anonymous.sitemap"/>
</providers>
</siteMap>
<LoggedInTemplate>
<asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
DataSourceID="SiteMapDataSource1"
DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#7C6F57"
MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px; position:
absolute;
top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick" Width="900px">
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
/>
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<StaticSelectedStyle BackColor="#5D7B9D" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
/>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DataBindings>
<asp:MenuItemBinding DataMember="SiteMapNode"
NavigateUrlField="Url" TextField="Title" />
</DataBindings>
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
SiteMapProvider="LoggedIn" />
</LoggedInTemplate>
I even tryed this example:
http://msdn2.microsoft.com/en-us/library/ms178426(d=ide).aspx :
<siteMap defaultProvider="XmlSiteMapProvider">
<providers>
<add name="LoggedIn" type="System.Web.XmlSiteMapProvider"
siteMapFile="LoggedIn.sitemap"/>
<add name="Anonymous" type="System.Web.XmlSiteMapProvider"
siteMapFile="Anonymous.sitemap"/>
</providers>
</siteMap>
But then I get this error:
Parser Error Message: The provider 'XmlSiteMapProvider' specified for the
defaultProvider does not exist in the providers collection.
If the SiteMapDataSource1.SiteMapProvider is set to "LoggedIn", then I want
it to use the "LoggedIn" SiteMapProvider, not use what is specified as the
defaultProvider.
Any suggestions on how to solve this are very welcome
Jeff
asp.net 2.0
My problem is that no matter what SiteMapProvider I specify in the code, it
always uses defaultProvider SiteMapProvider. In other words if I make these
changes to the SiteMapDataSource1:
<siteMap defaultProvider="Anonymous">
The menu which is based on this SiteMapProvider get menu items from the
Anoymous SiteMapProvider... But SiteMapDataSource1.SiteMapProvider is set to
"LoggedIn"
<siteMap defaultProvider="LoggedIn">
<providers>
<add name="LoggedIn" type="System.Web.XmlSiteMapProvider"
siteMapFile="LoggedIn.sitemap"/>
<add name="Anonymous" type="System.Web.XmlSiteMapProvider"
siteMapFile="Anonymous.sitemap"/>
</providers>
</siteMap>
<LoggedInTemplate>
<asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
DataSourceID="SiteMapDataSource1"
DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#7C6F57"
MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px; position:
absolute;
top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick" Width="900px">
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
/>
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<StaticSelectedStyle BackColor="#5D7B9D" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
/>
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DataBindings>
<asp:MenuItemBinding DataMember="SiteMapNode"
NavigateUrlField="Url" TextField="Title" />
</DataBindings>
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
SiteMapProvider="LoggedIn" />
</LoggedInTemplate>
I even tryed this example:
http://msdn2.microsoft.com/en-us/library/ms178426(d=ide).aspx :
<siteMap defaultProvider="XmlSiteMapProvider">
<providers>
<add name="LoggedIn" type="System.Web.XmlSiteMapProvider"
siteMapFile="LoggedIn.sitemap"/>
<add name="Anonymous" type="System.Web.XmlSiteMapProvider"
siteMapFile="Anonymous.sitemap"/>
</providers>
</siteMap>
But then I get this error:
Parser Error Message: The provider 'XmlSiteMapProvider' specified for the
defaultProvider does not exist in the providers collection.
If the SiteMapDataSource1.SiteMapProvider is set to "LoggedIn", then I want
it to use the "LoggedIn" SiteMapProvider, not use what is specified as the
defaultProvider.
Any suggestions on how to solve this are very welcome
Jeff