Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add drop-down menus 1

Status
Not open for further replies.

jimoo

Programmer
Jun 2, 2003
1,111
US
Using VS 2010 and creating a new web solution the default template provides menu buttons across the top. How do you add sub menu items that will display below the main menu. Below are the main menus. Do not concern yourself with the names or the pages, but rather how to create sub menus under each.

Thank you in advance for looking at this.


Code:
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
                    Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home" />
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" />
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="Help" />
                    </Items>
                </asp:Menu>
            </div>
        </div>

Jim
 

Submenus are added to the applicable menu item between the ending tag:

Code:
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
                    Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home" >
                            [red]<asp:MenuItem NavigateUrl="~/SomeOtherPage.aspx" Text = "Sub Menu Item 1"></asp:MenuItem>[/red]
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" />
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="Help" />
                    </Items>
                </asp:Menu>


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top