Click event for menu's child items

M

Med

Hi,

How can I fire click event for menus child items? My menu is located in a
WebUserControl as follow:

<asp:Menu ID="mnuMain"
runat="server"
OnMenuItemClick="Menu1_MenuItemClick"
Orientation=Horizontal >

<Items>
<asp:MenuItem Text="Parent1" Value="Parent1" />
<asp:MenuItem Text="Parent2" Value="Parent2">
<asp:MenuItem Text="Parent2Child" Value="Parent2Child" />
</asp:MenuItem>
</Items>

</asp:Menu>

Using following, I can trap click events for Parent1 and Parent2, but I also
need to get Parent2Child click events. How can I do it?

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
switch (e.Item.Value)
{
case "Parent1":
////....
break;

case "Parent2":
////....
break;
}
}

Thanks for your time.

Regards

Med
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top