Search code examples
c#jqueryasp.netcomposite-controls

Multi level drop down menu without css hover effects asp.net jquery


I am looking to create a multi level drop down menu in asp.net using c# for a composite control. Does anyone know, or know any pointers on how to create it?

I've looked at system.ui.webcontrols.menu, but I don't think this offers the functionality I require. Ideally it should be as simple as possible. It doesn't have to use hover effects of css as it will use an onclick to make the drop down fire.

Any pointers would be appreciated.

I am open to jQuery options aslong as they are quite simple, and easily modifiable.

Thanks again.


Solution

  • If you want an easy menu without on hover effects i would suggest the use of the Menu control. :P However, otherwise the easiest way would be using CSS and html. A normal list or something.


    Example ASP menu with/without submenu.

    <asp:Menu ID="Menu1" runat="server" >
    <Items>
    
    /*Single depth without subs*/
    <asp:MenuItem value="aa" Selectable="true" NavigateUrl="~/Pages/aa.aspx" text="aa">
    
    /*Single depth with subs*/
    <asp:MenuItem NavigateUrl="~/Pages/xx.aspx" Text="xx" Value="xx" Selectable="true">
    <asp:MenuItem NavigateUrl="~/Pages/yy.aspx" Text="yy" Value="yy" Selectable="true"></asp:MenuItem>
    <asp:MenuItem NavigateUrl="~/Pages/zz.aspx" Text="zz" Value="zz" Selectable="true"></asp:MenuItem>
    </asp:MenuItem>                    
    </Items>
    </asp:Menu>