Click here to Skip to main content
12,890,388 members (57,859 online)
Rate this:
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 4: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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2017
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