Menu style : Menu « Asp Control « ASP.Net






Menu style


<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Menu ID="Menu1" 
                  runat="server" 
                  BackColor="#FFFBD6" 
                  ForeColor="#990000" 
                  Font-Names="Verdana"
                  Font-Size="0.8em" 
                  StaticSubMenuIndent="10px" 
                  DynamicHorizontalOffset="2" 
                  Orientation="Horizontal">
            <StaticSelectedStyle BackColor="#FFCC66" />
            <StaticMenuItemStyle HorizontalPadding="5" VerticalPadding="2" />
            <DynamicMenuStyle BackColor="#FFFBD6" />
            <DynamicSelectedStyle BackColor="#FFCC66" />
            <DynamicMenuItemStyle HorizontalPadding="5" VerticalPadding="2" />
            <DynamicHoverStyle Font-Bold="True" BackColor="#990000" ForeColor="White" />
            <Items>
                <asp:MenuItem Value="New Item" Text="Windows">
                    <asp:MenuItem Value="Windows XP" Text="Windows XP">
                        <asp:MenuItem Value="Home Edition" Text="Home Edition"></asp:MenuItem>
                        <asp:MenuItem Value="Professional" Text="Professional"></asp:MenuItem>
                    </asp:MenuItem>
                    <asp:MenuItem Value="Windows 2003 Server" Text="Windows 2003 Server"></asp:MenuItem>
                </asp:MenuItem>
                <asp:MenuItem Value="New Item" Text="Mac OS X">
                    <asp:MenuItem Value="Mac OS X" Text="Mac OS X">
                        <asp:MenuItem Value="10.3" Text="10.3"></asp:MenuItem>
                        <asp:MenuItem Value="10.4" Text="10.4"></asp:MenuItem>
                    </asp:MenuItem>
                </asp:MenuItem>
            </Items>
            <StaticHoverStyle Font-Bold="True" BackColor="#990000" ForeColor="White" />
        </asp:Menu>
    </form>
</body>
</html>

 








Related examples in the same category

1.Using the MenuItemClick event (C#)
2.Using the MenuItemClick event (VB)
3.Using custom images
4.Applying divider images to dynamic items
5.A simple use of the Menu control
6.Style menu
7.Adding a hover style to static items in the menu control
8.Adding a hover style to dynamic items in the menu control
9.Forcing the menu items to use a horizontal orientation
10.Menu with CSS style
11.Menu control
12.Menu style: Orientation, StaticSubMenuIndent
13.Data Binding with Menu Control