Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2009, 05:39 PM
Authorized User
 
Join Date: Sep 2008
Posts: 20
Thanks: 2
Thanked 0 Times in 0 Posts
Default Multiple Menus

I have a site which has a menu on the MasterPage. There are no subsidiary popups from this menu. On a particular page I want to add another menu in the right sidebar which will have one or more subsidiary pages per menu item. In the .sitemap file I have the following:
Code:
<siteMapNode>
 <siteMapNode url="mainMenu.aspx"title="MasterPage Menu"description=""roles="*">
   <siteMapNode url="Default.aspx"title="Home"description=""roles="*">
   </siteMapNode>
           "etc"
 </siteMapNode>
 <siteMapNode url="ClubRoom.aspx"title="ClubRoom Menu"description=""roles="*">
   <siteMapNode url="Fixtures.aspx"title="Fixtures"description=""roles="*">
           "Subsidiary nodes to 3 levels"
   </siteMapNode>
 </siteMapNode>
</siteMapNode>
My menu controls are as follows:

MasterPage
Code:
<asp:SiteMapDataSourceID="RLSBC_MenuProvider"runat="server"ShowStartingNode="False"StartingNodeUrl="mainMenu.aspx"/>
ClubRoom
Code:
<asp:SiteMapDataSourceID="RLSBC_SidebarProvider"runat="server"ShowStartingNode="False"StartingNodeUrl="ClubRoom.aspx"/>
The MasterPage menu displays exactly as I want it. I don't get any errors when the ClubRoom is displayed; but then again I don't get any menu items either.

Is it possible to do what I want?
__________________
Thanks, wagham
 
Old March 27th, 2009, 07:58 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Hi Wagham,

Yes it is indeed possible and I managed to get your very menu running.
Is it possible to post your ClubRoom menu code, just in case there is something strange with that, and maybe a couple more levels of the sitemap? I can't see any other issues with what you've got.

Phil
 
Old March 30th, 2009, 05:17 PM
Authorized User
 
Join Date: Sep 2008
Posts: 20
Thanks: 2
Thanked 0 Times in 0 Posts
Default

My code for the menu that appears at the top of every page on the Masterpage.aspx is
Code:
<divid="mainMenu">
<asp:SiteMapDataSourceID="RLSBC_MenuProvider"runat="server"ShowStartingNode="False"StartingNodeUrl="mainMenu.aspx"/>
<asp:MenuID="Menu1"runat="server"CssClass="mainMenu"SkinID="mainMenu"DataSourceID="RLSBC_MenuProvider">
<StaticMenuItemStyleHorizontalPadding="10px"VerticalPadding="2px"Font-Size="10pt"/>
<DynamicMenuItemStyleHorizontalPadding="5px"VerticalPadding="2px"/>
<StaticHoverStyleBackColor="#00007F"ForeColor="White"/>
<DynamicHoverStyleBackColor="#00007F"ForeColor="White"/>
<StaticSelectedStyleBackColor="#507CD1"/>
<DynamicSelectedStyleBackColor="#507CD1"/>
<DynamicMenuStyleBackColor="#B5C7DE"/>
</asp:Menu>
</div>
My code for the menu that appears on the ClubRoom page on a sidebar on the ClubRoom.aspx is
Code:
<divid="sideMenu">
<asp:SiteMapDataSourceID="RLSBC_SidebarProvider"runat="server"ShowStartingNode="False"StartingNodeUrl="ClubRoom.aspx"/>
<asp:MenuID="Menu1"runat="server"CssClass="sideMenu"SkinID="sideMenu"DataSourceID="RLSBC_SidebarProvider">
<StaticMenuItemStyleHorizontalPadding="10px"VerticalPadding="2px"Font-Size="10pt"/>
<DynamicMenuItemStyleHorizontalPadding="5px"VerticalPadding="2px"/>
<StaticHoverStyleBackColor="#00007F"ForeColor="White"/>
<DynamicHoverStyleBackColor="#00007F"ForeColor="White"/>
<StaticSelectedStyleBackColor="#507CD1"/>
<DynamicSelectedStyleBackColor="#507CD1"/>
<DynamicMenuStyleBackColor="#B5C7DE"/>
</asp:Menu>
</div>
The .sitemap code is
Code:
<siteMapxmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNodeurl="ClubRoom.aspx"title="ClubRoom Menu"description=""roles="*">
<siteMapNodeurl="Fixtures.aspx"title="Fixtures"description=""roles="*">
<siteMapNodeurl="MensMatches.aspx"title="Men's Matches"description=""roles="*">
</siteMapNode>
<siteMapNodeurl="LadiesMatches.aspx"title="Ladies' Matches"description=""roles="*">
</siteMapNode>
<siteMapNodeurl="CourierCup.aspx"title="Courier Cup"description=""roles="*">
</siteMapNode>
</siteMapNode>
</siteMapNode>
<siteMapNodeurl="mainMenu.aspx"title="MasterPage Menu"description=""roles="*">
<siteMapNodeurl="Default.aspx"title="Home"description=""roles="*">
</siteMapNode>
<siteMapNodeurl="ClubRoom/ClubRoom.aspx"title="Club Room"description=""roles="*">
</siteMapNode>
<siteMapNodeurl="Anonymous/Contact.aspx"title="Contact"description=""roles="*">
</siteMapNode>
<siteMapNodeurl="Administration/Administration.aspx"title="Admin"description=""roles="Administrators">
</siteMapNode>
</siteMapNode>
</siteMapNode>
</siteMap>

The code in the .skin file is
Code:
<asp:MenuSkinID="mainMenu"runat="server"BackColor="#CB3333"StaticSubMenuIndent="10px"
DynamicEnableDefaultPopOutImage="False"DynamicHorizontalOffset="4"Font-Bold="False"
Font-Names="Verdana"Font-Size="Small"ForeColor="Yellow"Height="20px"Orientation="Horizontal"
StaticEnableDefaultPopOutImage="False"/>
<asp:MenuSkinID="sideMenu"runat="server"BackColor="#CB3333"StaticSubMenuIndent="10px"
DynamicEnableDefaultPopOutImage="False"DynamicHorizontalOffset="4"Font-Bold="False"
Font-Names="Verdana"Font-Size="Small"ForeColor="Yellow"Height="20px"Orientation="Vertical"
StaticEnableDefaultPopOutImage="False"/>
The .css file just has positioning commands in it. I've tried to add z-order to the css file just in case it was behind the sidebar but without any success.
__________________
Thanks, wagham
 
Old April 5th, 2009, 04:43 PM
Authorized User
 
Join Date: Sep 2008
Posts: 20
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I'm not quite sure why, but it is now working with the code apsted above.
__________________
Thanks, wagham





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Menus - Using multiple dropdown boxes Sebastiaan ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2007 06:25 AM
Search with multiple menus forry SQL Language 0 November 5th, 2005 07:23 AM
sub menus matshediso HTML Code Clinic 2 January 31st, 2005 05:15 AM
Menus Frank Schmuck BOOK: Beginning ASP.NET 1.0 1 June 6th, 2003 01:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.