Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top