You can just make MenuItem
not self-closing, but embed a submenu (drop-down) elements inside it. Like this:
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/Default.aspx" Text="××Ŗ ××××Ē"> <asp:MenuItem NavigateUrl="~/Page1.aspx" Text="Page1"> <asp:MenuItem NavigateUrl="~/Page2.aspx" Text="Page2"> </asp:MenuItem> <asp:MenuItem NavigateUrl="~/About.aspx" Text="×ĸ××× ×"/> </Items> </asp:Menu>
In the above example, "Page1" and "Page 2" will drop out of "××Ŗ ××××Ē". There are some good examples / explanations here on MSDN .
A fair warning, these controls can be a little complicated in style. So if you want more flexibility / control, I would suggest making your menu using CSS (and javascript if you need it) with an unordered list of HTML ( ul
)
source share