1

I have the following ASP:Menu

<asp:Menu id="menu_mymenu" runat="server"  OnMenuItemClick="menu_mymenu_Click">
    <Items>
        <asp:MenuItem Text="menu_1" Value ="menu_1">
            <asp:MenuItem Text="menu_a" Value="menu_a" />
            <asp:MenuItem Text="menu_b" Value="menu_b"/>
        </asp:MenuItem>
    </Items>                                                               
</asp:Menu>

On mouse over it displays submenus menu_a and menu_b. I would like the onclick on menu_1 to display the submenus menu_a and menu_b in the same way without posting back. Is there anyway to do this?

drobison
  • 858
  • 1
  • 14
  • 23

2 Answers2

0

It looks like this is not something that is particularly easy to do and may be a bit hacky. I've seen a lot of suggestions of trying to use a treeview instead of the menu control. Anyway here are some resources I found and a solution that appears may do the trick:

http://forums.asp.net/t/1250342.aspx

Is it possible to force a menu popout to trigger on click instead of mouseover?

If it is absolutely necessary to have this be on click then it would be worth looking into a solution that fits your needs. In this case I would recommend looking into a treeview or looking at a purely css / javascript solution.

Hopefully this gets you down the right path!

Community
  • 1
  • 1
Timothy Randall
  • 17,634
  • 1
  • 15
  • 27
  • Thanks for the links. It looks like if I want to get it to work it is gonna be a hacky solution. I may look into a different menu system. – drobison Apr 15 '13 at 18:33
0

I have customized as per the requirement; below is the link for complete solution.

https://stackoverflow.com/a/60986351/3099784

MAQ
  • 95
  • 8