Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
I am developing c# web application .net frame work 4.5.
I have created a menue control through following code.
<asp:Menu ID="DropDownMenu" runat="server" OnMenuItemClick="DropDownMenu_MenuItemClick" Orientation="Horizontal">
            <DynamicHoverStyle BackColor="Green" />
                <asp:MenuItem Text="Home" Value="Item1">
                    <asp:MenuItem Text="Sub Item1" Value="Sub Item1"></asp:MenuItem>
                    <asp:MenuItem Text="Sub Item2" Value="Sub Item2"></asp:MenuItem>
                    <asp:MenuItem Text="Sub Item3" Value="Sub Item3"></asp:MenuItem>
                <asp:MenuItem Text="Functions" Value="Item5">
                    <asp:MenuItem Text="Reverse Complement" Value="Sub Item1"></asp:MenuItem>
                    <asp:MenuItem Text="Translation" Value="Sub Item2"></asp:MenuItem>
                    <asp:MenuItem Text="Reverse Translation" Value="Sub Item3"></asp:MenuItem>
                    <asp:MenuItem Text="Orf finder" Value="Sub Item4"></asp:MenuItem>
                    <asp:MenuItem Text="In Silico PCR" Value="Sub Item5"></asp:MenuItem>

The problem is that i dont know how to select a specific menu item or sub item.
e.g if i select menu sub item"translation", it should go on a new page.
would any one guide me please that how to select menue items and sub items through c# code ????
Posted 4-Oct-12 5:48am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to use Selected property of a MenuItem.
Refer: MSDN: MenuItem.Selected Property [^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Zoltán Zörgő 320
1 CHill60 185
2 /\jmot 160
3 Peter Leow 160
4 Pikoh 125
0 Sergey Alexandrovich Kryukov 9,423
1 OriginalGriff 6,891
2 Peter Leow 4,637
3 Zoltán Zörgő 4,304
4 CHill60 2,932

Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100