Monday, March 26, 2012

newbie: Problems creating asp.net 2.0 Menu

Hey

ASP.NET 2.0

On my web page I got 2 menu controls: menu A is a horizontal menu displaying
menuitems at the top level. Menu B displays the submenuitems related to what
is selected in menu A. Menu A and Menu B are using the same sitemap
provider.. This works fine today.

But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I also
want it show some other submenuitems which isn't affect by what is selected
in menu A

Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F

In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...

Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>

This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />

I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A

Best Regards

JeffLook at the bottom

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hey
>
ASP.NET 2.0
>
On my web page I got 2 menu controls: menu A is a horizontal menu
displaying menuitems at the top level. Menu B displays the submenuitems
related to what is selected in menu A. Menu A and Menu B are using the
same sitemap provider.. This works fine today.
>
But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I
also want it show some other submenuitems which isn't affect by what is
selected in menu A
>
Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F
>
In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...
>
Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
>
This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />
>
I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A
>
Best Regards
>
Jeff
>


the menu markup I posted in my previous post is NOT for menu B it is for
menu A

Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>

I still wondering how to solve this

Jeff
I've solved this by using 2 menu controls

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>


I didn't find a solution so I had to use a workaround. Using 2 menu controls
instead of only 1

So I consider this thread for solved

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>


>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>

0 comments:

Post a Comment