Reputation: 908
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?
Upvotes: 1
Views: 4409
Reputation: 144
I have customized as per the requirement; below is the link for complete solution.
https://stackoverflow.com/a/60986351/3099784
Upvotes: 0
Reputation: 18564
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!
Upvotes: 0