Click event for menu's child items

Discussion in 'ASP .Net' started by Med, Mar 19, 2007.

  1. Med

    Med Guest

    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
    Med, Mar 19, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    820
    Purvi T
    Oct 19, 2004
  2. Bryan
    Replies:
    1
    Views:
    763
    Steven Cheng[MSFT]
    Mar 1, 2006
  3. Chu
    Replies:
    2
    Views:
    894
    Winista
    Apr 10, 2006
  4. Jeff Rodriguez
    Replies:
    23
    Views:
    1,083
    David Schwartz
    Dec 9, 2003
  5. Larry Bud
    Replies:
    13
    Views:
    7,640
    Larry Bud
    Jan 7, 2008
Loading...

Share This Page