I\'m using the asp:Menu control on an ASP.NET 4.0 Webforms page with table-free rendering mode:
The above solution was close, but did not work for me. It required the slight modification below in order to fix the problem being described. When I create a new ASP.NET web forms application project using Visual Studio 2010, the CSS that is generated for the menu by default makes use of ".menu" (CSS classes) to apply style rather than "#menu" (an element with ID of "menu").
#menu - does not work
.menu
- does work
So, in other words, put this into your CSS file near the bottom:
.menu ul li ul
{
display: none;
}
.menu ul li
{
position: relative;
float: left;
list-style: none;
}