3

I'm working on a site that will have a primary and secondary navigation that I'd like to generate using ASP.NET's Menu controls. Both will be based on the web.sitemap - the primary from the root, and the secondary will be a section of nodes depending on which page you're on.

The first go of adding a menu worked perfectly:

<form runat="server">
        <asp:SiteMapDataSource id="nav1" runat="server" StartingNodeUrl="~/en/default.aspx" ShowStartingNode="False" />
        <asp:Menu runat="server" DataSourceId="nav1" disappearafter="1000" MaximumDynamicDisplayLevels="1" />           
</form>

However, after adding a second menu control, while the first menu still works as expected, the second menu's the first dropdown never disappears and any other dropdowns don't open at all:

<form runat="server">
        <asp:SiteMapDataSource id="nav1" runat="server" StartingNodeUrl="~/default.aspx" ShowStartingNode="False" />
        <asp:Menu runat="server" DataSourceId="nav1" MaximumDynamicDisplayLevels="1" />

        <asp:SiteMapDataSource id="nav2" runat="server" StartingNodeUrl="~/section/default.aspx"/>
        <asp:Menu runat="server" DataSourceId="nav2" MaximumDynamicDisplayLevels="1" />         
</form>

UPDATE: Turns out it's only happening in the Mono environment I'm using for development, and the menus are working perfectly on an actual .net server. I'll happily work around it knowing that it's just going to be an issue during development.

steve
  • 576
  • 1
  • 5
  • 12
  • Could you pls post your web.sitemap. The code you posted seems to work fine... – Elementenfresser Jan 31 '14 at 15:35
  • please show us your sitemap file so that we can help you..! – SHEKHAR SHETE Feb 04 '14 at 09:59
  • Guess I should have mentioned that I'm developing on a Mac using Mono, since that seems to be the root of the problem. I moved the files onto an actual .net server and the menus are working just fine – steve Feb 06 '14 at 16:17
  • @steve, great that you worked out the source of the problem! Just for a better overview, please add your solution as an answer and mark it as accepted. so we all see on first sight, that this question is already solved. Thanks! :-) – Jens H Feb 06 '14 at 16:25

1 Answers1

0

Turns out it's only happening in the Mono environment I'm using for development, and the menus are working perfectly on an actual .net server. I'll happily work around it knowing that it's just going to be an issue during development.

steve
  • 576
  • 1
  • 5
  • 12