Menu control

Last post 11-10-2009 9:56 PM by Hong-Gang Chen - MSFT. 4 replies.

Sort Posts:

  • Menu control

    11-05-2009, 1:24 PM
    • Member
      9 point Member
    • forexbob
    • Member since 10-10-2008, 4:39 PM
    • Posts 12

    Hi,

    I'm not exactly sure where this post should actually go, but as I'm still a rookie at this stuff, I figured this would be the place to start. I'm not sure if this an asp.net issue, a server 2008 issue or an IIS 7 issue, or strictly my issue, so here it is.

    I'm using VS2008 and I'm putting a Menu Control on a page. I set it's properties to Horizontal and StaticDisplayLevels="2"
    When I go into the design window in VS2008 it shows the Menu as being horizontal. However when displayed in a browser it shows only "Home" and when hovered over the Menu is still vertical. The same result occurs using VS2008 internal web server or if published online to my server.

    This actually worked fine before and now it doesn't. Originally the site was designed in VWD and I've since upgraded to VS2008, but I can't see how that should make any difference. If I use VWD now the same problem occurs. I've tried it in multiple browser types, no joy. I've used the Menu on a page with no MasterPage or CSS, no joy.

    Ideas?

    Thanks
    Bob

  • Re: Menu control

    11-05-2009, 9:58 PM
    • Member
      84 point Member
    • StanleyGu
    • Member since 10-27-2009, 12:18 AM
    • Raleigh, North Carolina
    • Posts 2

    I do not have your code. But the following is a sample code that works for me. You may want to compare and hope it helps.

    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" StartingNodeOffset="0" />

    <asp:Menu ID="NavigationMenu" runat="server" DataSourceID="SiteMapDataSource1" Width="100%" StaticDisplayLevels="1" Orientation="Horizontal" OnMenuItemDataBound="NavigationMenu_MenuItemDataBound" OnMenuItemClick="NavigationMenu_MenuItemClick" > <StaticMenuItemStyle HorizontalPadding="10px" VerticalPadding="2px" BorderStyle="None" /> </asp:Menu>

  • Re: Menu control

    11-06-2009, 4:25 AM
    Answer
    • All-Star
      17,101 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,364
    • TrustedFriends-MVPs

    Horizontal means that the first level of nodes is displayed horizontally, while child nodes drop downwards. The standard sitemap supports a single root node, with all other nodes descended from that root node, which means that the single root node is the first level. This is why you see only a single Home node. You can easily change this by setting the StaticDisplayLevels property on the Menu control to 2, meaning that the first 2 levels of the menu should be shown statically (ie, always displayed).

  • Re: Menu control

    11-06-2009, 1:28 PM
    • Member
      9 point Member
    • forexbob
    • Member since 10-10-2008, 4:39 PM
    • Posts 12

    Hi

    Thanks guys for your replies. I do have the staticdisplaymode set to 2 yet it still only shows the root node "Home".

    I've tried various values in here as well as numerous other permutations and combinations yet nothing seems to work.

    Any other ideas?

    Bob

  • Re: Menu control

    11-10-2009, 9:56 PM

    Have you checked Dave Sussman's replied, I hope you check again.

    By the way, if you need some further help, please post some code here for us checking.

    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (5 items)