Muokkaa

Jaa


Menu Class

Definition

Displays a menu in an ASP.NET Web page.

public ref class Menu : System::Web::UI::WebControls::HierarchicalDataBoundControl, System::Web::UI::INamingContainer, System::Web::UI::IPostBackEventHandler
[System.Web.UI.ControlValueProperty("SelectedValue")]
public class Menu : System.Web.UI.WebControls.HierarchicalDataBoundControl, System.Web.UI.INamingContainer, System.Web.UI.IPostBackEventHandler
[<System.Web.UI.ControlValueProperty("SelectedValue")>]
type Menu = class
    inherit HierarchicalDataBoundControl
    interface IPostBackEventHandler
    interface INamingContainer
Public Class Menu
Inherits HierarchicalDataBoundControl
Implements INamingContainer, IPostBackEventHandler
Inheritance
Attributes
Implements

Examples

A Visual Studio Web site project with source code is available to accompany this topic: Download.

The following code example demonstrates how to create a Menu control with static menu items using declarative syntax.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu Declarative Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu Declarative Example</h3>
    
      <!-- Use declarative syntax to create the   -->
      <!-- menu structure. Submenu items are      -->
      <!-- created by nesting them in parent menu -->
      <!-- items.                                 -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        font-names="Arial" 
        target="_blank"  
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSteelBlue"
          forecolor="Black"/>
        <statichoverstyle backcolor="LightSkyBlue"/>
        <dynamicmenuitemstyle backcolor="Black"
          forecolor="Silver"/>
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu Declarative Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu Declarative Example</h3>
    
      <!-- Use declarative syntax to create the   -->
      <!-- menu structure. Submenu items are      -->
      <!-- created by nesting them in parent menu -->
      <!-- items.                                 -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        font-names="Arial" 
        target="_blank"  
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSteelBlue"
          forecolor="Black"/>
        <statichoverstyle backcolor="LightSkyBlue"/>
        <dynamicmenuitemstyle backcolor="Black"
          forecolor="Silver"/>
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>
      
        <items>
          <asp:menuitem navigateurl="Home.aspx" 
            text="Home"
            tooltip="Home">
            <asp:menuitem navigateurl="Music.aspx"
              text="Music"
              tooltip="Music">
              <asp:menuitem navigateurl="Classical.aspx" 
                text="Classical"
                tooltip="Classical"/>
              <asp:menuitem navigateurl="Rock.aspx"
                text="Rock"
                tooltip="Rock"/>
              <asp:menuitem navigateurl="Jazz.aspx"
                text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem navigateurl="Movies.aspx"
              text="Movies"
              tooltip="Movies">
              <asp:menuitem navigateurl="Action.aspx"
                text="Action"
                tooltip="Action"/>
              <asp:menuitem navigateurl="Drama.aspx"
                text="Drama"
                tooltip="Drama"/>
              <asp:menuitem navigateurl="Musical.aspx"
                text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

The following code example demonstrates how to bind the Menu control to a SiteMapDataSource control. For this example to work correctly, you must copy the sample site map data below to a file named Web.sitemap.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu DataBinding Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu DataBinding Example</h3>
    
      <!-- Bind the Menu control to a SiteMapDataSource control.  -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        font-names="Arial" 
        target="_blank"
        datasourceid="MenuSource"   
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSteelBlue"
          forecolor="Black"/>
        <statichoverstyle backcolor="LightSkyBlue"/>
        <dynamicmenuitemstyle backcolor="Black"
          forecolor="Silver"/>
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>

      </asp:menu>
      
      <asp:SiteMapDataSource id="MenuSource"
        runat="server"/>        

    </form>
  </body>
</html>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

  <!-- For the hover styles of the Menu control to  -->
  <!-- work correctly, you must include this head   -->
  <!-- element.                                     -->
  <head runat="server">
    <title>Menu DataBinding Example</title>
</head>

  <body>
    <form id="form1" runat="server">
    
      <h3>Menu DataBinding Example</h3>
    
      <!-- Bind the Menu control to a SiteMapDataSource control.  -->
      <asp:menu id="NavigationMenu"
        disappearafter="2000"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        font-names="Arial" 
        target="_blank"
        datasourceid="MenuSource"   
        runat="server">
        
        <staticmenuitemstyle backcolor="LightSteelBlue"
          forecolor="Black"/>
        <statichoverstyle backcolor="LightSkyBlue"/>
        <dynamicmenuitemstyle backcolor="Black"
          forecolor="Silver"/>
        <dynamichoverstyle backcolor="LightSkyBlue"
          forecolor="Black"/>

      </asp:menu>
      
      <asp:SiteMapDataSource id="MenuSource"
        runat="server"/>        

    </form>
  </body>
</html>

The following is sample site map data for the previous example.

<siteMap>  
  <siteMapNode url="~\Home.aspx"   
    title="Home"  
    description="Home">  
    <siteMapNode url="~\Music.aspx"  
      title="Music"  
      description="Music">  
      <siteMapNode url="~\Classical.aspx"   
        title="Classical"  
        description="Classical"/>  
      <siteMapNode url="~\Rock.aspx"  
        title="Rock"  
        description="Rock"/>  
      <siteMapNode url="~\Jazz.aspx"  
        title="Jazz"  
        description="Jazz"/>  
    </siteMapNode>  
    <siteMapNode url="~\Movies.aspx"  
      title="Movies"  
      description="Movies">  
      <siteMapNode url="~\Action.aspx"  
        title="Action"  
        description="Action"/>  
      <siteMapNode url="~\Drama.aspx"  
        title="Drama"  
        description="Drama"/>  
      <siteMapNode url="~\Musical.aspx"  
        title="Musical"  
        description="Musical"/>  
    </siteMapNode>  
  </siteMapNode>  
</siteMap>  

Remarks

In this topic:

Introduction

The Menu control is used to display a menu in an ASP.NET Web page and is often used in combination with a SiteMapDataSource control for navigating a Web site. The Menu control supports the following features:

  • Data binding that allows the control's menu items to be bound to hierarchal data sources.

  • Site navigation through integration with the SiteMapDataSource control.

  • Programmatic access to the Menu object model to dynamically create menus, populate menu items, set properties, and so on.

  • Customizable appearance through themes, user-defined images, styles, and user-defined templates.

When the user clicks a menu item, the Menu control can either navigate to a linked Web page or simply post back to the server. If the NavigateUrl property of a menu item is set, the Menu control navigates to the linked page; otherwise, it posts the page back to the server for processing. By default, a linked page is displayed in the same window or frame as the Menu control. To display the linked content in a different window or frame, use the Target property of the Menu control.

Note

The Target property affects every menu item in the control. To specify a window or frame for an individual menu item, set the Target property of the MenuItem object directly.

The Menu control displays two types of menus: a static menu and a dynamic menu. The static menu is always displayed in a Menu control. By default, the menu items at the root level (level 0) are displayed in the static menu. You can display additional menu levels (static submenus) within the static menu by setting the StaticDisplayLevels property. Menu items (if any) with a higher level than the value specified by the StaticDisplayLevels property are displayed in a dynamic menu. A dynamic menu appears only when the user positions the mouse pointer over the parent menu item that contains a dynamic submenu. Dynamic menus automatically disappear after a certain duration. Use the DisappearAfter property to specify the duration.

Note

A dynamic menu also disappears when the user clicks outside of the menu.

You can also limit the number of levels displayed in a dynamic menu by setting the MaximumDynamicDisplayLevels property. Menu levels higher than the specified value are discarded.

Note

The Menu control is not designed to be used inside an UpdatePanel control. You can add the Menu control only to a page outside an UpdatePanel control. UpdatePanel controls are used to update selected regions of a page instead of updating the whole page with a postback. For more information, see UpdatePanel Control Overview and Partial-Page Rendering Overview.

A Menu control is made up of a tree of menu items represented by MenuItem objects. Menu items at the top level (level 0) are called root menu items. A menu item that has a parent menu item is called a child menu item. All root menu items are stored in the Items collection. Child menu items are stored in a parent menu item's ChildItems collection.

Each menu item has a Text and a Value property. The value of the Text property is displayed in the Menu control, while the Value property is used to store any additional data about the menu item, such as data passed to the postback event associated with the menu item. When clicked, a menu item can navigate to another Web page indicated by the NavigateUrl property.

Note

If the NavigateUrl property is not set for a menu item, the Menu control simply submits the page to the server for processing when the menu item is clicked.

You can also optionally display an image in a menu item by setting the ImageUrl property.

For more information on menu items, see MenuItem.

Static Data

The simplest data model of the Menu control is static menu items. To display static menu items using declarative syntax, first nest opening and closing <Items> tags between the opening and closing tags of the Menu control. Next, create the menu structure by nesting <asp:MenuItem> elements between the opening and closing <Items> tags. Each <asp:MenuItem> element represents a menu item in the control and maps to a MenuItem object. You can set the properties of each menu item by setting the attributes of its <asp:MenuItem> element. To create submenu items, nest additional <asp:MenuItem> elements between the opening and closing <asp:MenuItem> tags of the parent menu item.

Binding to Data

The Menu control can use any hierarchal data source control, such as an XmlDataSource control or a SiteMapDataSource control. To bind to a hierarchal data source control, set the DataSourceID property of the Menu control to the ID value of the data source control. The Menu control automatically binds to the specified data source control. This is the preferred method to bind to data.

When binding to a data source where each data item contains multiple properties (such as an XML element with several attributes), a menu item displays the value returned by the ToString method of the data item by default. In the case of an XML element, the menu item displays the element name, which shows the underlying structure of the menu tree but is not very useful otherwise. You can bind a menu item to a specific data item property by using the DataBindings collection to specify menu item bindings. The DataBindings collection contains MenuItemBinding objects that define the relationship between a data item and the menu item it is binding to. You can specify the criteria for binding and the data item property to display in the node. For more information on menu item bindings, see MenuItemBinding.

You cannot create empty nodes in a Menu control by setting the Text or TextField properties to the empty string (""). Setting these properties to the empty string has the same effect as not setting the properties. In that case, the Menu control creates a default binding using the DataSource property. For more information, see Binding to Databases.

Customizing the User Interface

There are many ways to customize the appearance of the Menu control. First, you can specify whether the Menu control is rendered horizontally or vertically by setting the Orientation property. You can also specify a different style (such as font size and color) for each of the menu item types.

If you use cascading style sheets (CSS) to customize the appearance of the control, use either inline styles or a separate CSS file, but not both. Using both inline styles and a separate CSS file could cause unexpected results. For more information on using style sheets with controls, see Web Server Controls and CSS Styles.

The following table lists the available menu item styles.

Menu item style property Description
DynamicHoverStyle The style settings for a dynamic menu item when the mouse pointer is positioned over it.
DynamicMenuItemStyle The style settings for an individual dynamic menu item.
DynamicMenuStyle The style settings for a dynamic menu.
DynamicSelectedStyle The style settings for the currently selected dynamic menu item.
StaticHoverStyle The style settings for a static menu item when the mouse pointer is positioned over it.
StaticMenuItemStyle The style settings for an individual static menu item.
StaticMenuStyle The style settings for a static menu.
StaticSelectedStyle The style settings for the currently selected static menu item.

Instead of setting the individual style properties, you can specify styles that are applied to menu items based on their level by using the following style collections.

Level style collections Description
LevelMenuItemStyles A collection of MenuItemStyle objects that control the style of the menu items on a level basis.
LevelSelectedStyles A collection of MenuItemStyle objects that control the style of selected menu items on a level basis.
LevelSubMenuStyles A collection of MenuItemStyle objects that control the style of the submenu items on a level basis.

The first style in the collection corresponds to the style of the menu items at the first depth level in the menu tree. The second style in the collection corresponds to the style of the menu items at the second depth level in the menu tree, and so on. This is most often used to generate table of contents-style navigation menus where menu items at a certain depth should have the same appearance, regardless of whether they have submenus.

Note

If you use any of the level style collections listed in the previous table to define the style for the Menu control, these style settings override the individual menu item style properties.

Another way to alter the appearance of the control is to customize the images displayed in the Menu control. You can specify your own custom image for the different parts of the control by setting the properties shown in the following table.

Image property Description
DynamicBottomSeparatorImageUrl An optional image displayed at the bottom of a dynamic menu item to separate it from other menu items.
DynamicPopOutImageUrl An optional image displayed in a dynamic menu item to indicate that it has a submenu.
DynamicTopSeparatorImageUrl An optional image displayed at the top of a dynamic menu item to separate it from other menu items.
ScrollDownImageUrl The image displayed at the bottom of a menu item to indicate that the user can scroll down to view additional menu items.
ScrollUpImageUrl The image displayed at the top of a menu item to indicate that the user can scroll up to view additional menu items.
StaticBottomSeparatorImageUrl An optional image displayed at the bottom of a static menu item to separate it from other menu items.
StaticPopOutImageUrl An optional image displayed in a static menu item to indicate that it has a submenu.
StaticTopSeparatorImageUrl An optional image displayed at the top of a static menu item to separate it from other menu items.

For complete control of the user interface (UI), you can define your own custom templates for the Menu control using the following template properties.

Template property Description
DynamicItemTemplate The template that contains the custom content to render for a dynamic menu item.
StaticItemTemplate The template that contains the custom content to render for a static menu item.

You can control the vertical and horizontal position of a dynamic menu relative to its parent menu item by setting the DynamicVerticalOffset and DynamicHorizontalOffset properties, respectively. To control the indentation of the static submenu items within a static menu, use the StaticSubMenuIndent property.

Events

The Menu control provides several events that you can program against. This allows you to run a custom routine whenever an event occurs. The following table lists the supported events.

Event Description
MenuItemClick Occurs when a menu item is clicked. This event is commonly used to synchronize a Menu control with another control on the page.
MenuItemDataBound Occurs when a menu item is bound to data. This event is commonly used to modify a menu item before it is rendered in a Menu control.

Accessibility

For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

Declarative Syntax

<asp:Menu  
    AccessKey="string"  
    BackColor="color name|#dddddd"  
    BorderColor="color name|#dddddd"  
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|  
        Inset|Outset"  
    BorderWidth="size"  
    CssClass="string"  
    DataSource="string"  
    DataSourceID="string"  
    DisappearAfter="integer"  
    DynamicBottomSeparatorImageUrl="uri"  
    DynamicEnableDefaultPopOutImage="True|False"  
    DynamicHorizontalOffset="integer"  
    DynamicItemFormatString="string"  
    DynamicPopOutImageTextFormatString="string"  
    DynamicPopOutImageUrl="uri"  
    DynamicTopSeparatorImageUrl="uri"  
    DynamicVerticalOffset="integer"  
    Enabled="True|False"  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    Font-Bold="True|False"  
    Font-Italic="True|False"  
    Font-Names="string"  
    Font-Overline="True|False"  
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|  
        Large|X-Large|XX-Large"  
    Font-Strikeout="True|False"  
    Font-Underline="True|False"  
    ForeColor="color name|#dddddd"  
    Height="size"  
    ID="string"  
    ItemWrap="True|False"  
    MaximumDynamicDisplayLevels="integer"  
    OnDataBinding="DataBinding event handler"  
    OnDataBound="DataBound event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnLoad="Load event handler"  
    OnMenuItemClick="MenuItemClick event handler"  
    OnMenuItemDataBound="MenuItemDataBound event handler"  
    OnPreRender="PreRender event handler"  
    OnUnload="Unload event handler"  
    Orientation="Horizontal|Vertical"  
    PathSeparator="string"  
    runat="server"  
    ScrollDownImageUrl="uri"  
    ScrollDownText="string"  
    ScrollUpImageUrl="uri"  
    ScrollUpText="string"  
    SkinID="string"  
    SkipLinkText="string"  
    StaticBottomSeparatorImageUrl="uri"  
    StaticDisplayLevels="integer"  
    StaticEnableDefaultPopOutImage="True|False"  
    StaticItemFormatString="string"  
    StaticPopOutImageTextFormatString="string"  
    StaticPopOutImageUrl="uri"  
    StaticSubMenuIndent="size"  
    StaticTopSeparatorImageUrl="uri"  
    Style="string"  
    TabIndex="integer"  
    Target="string"  
    ToolTip="string"  
    Visible="True|False"  
    Width="size"  
>  
        <DataBindings>  
                <asp:MenuItemBinding  
                    DataMember="string"  
                    Depth="integer"  
                    Enabled="True|False"  
                    EnabledField="string"  
                    FormatString="string"  
                    ImageUrl="uri"  
                    ImageUrlField="string"  
                    NavigateUrl="uri"  
                    NavigateUrlField="string"  
                    PopOutImageUrl="uri"  
                    PopOutImageUrlField="string"  
                    Selectable="True|False"  
                    SelectableField="string"  
                    SeparatorImageUrl="uri"  
                    SeparatorImageUrlField="string"  
                    Target="string"  
                    TargetField="string"  
                    Text="string"  
                    TextField="string"  
                    ToolTip="string"  
                    ToolTipField="string"  
                    Value="string"  
                    ValueField="string"  
                />  
        </DataBindings>  
        <DynamicHoverStyle />  
        <DynamicItemTemplate>  
            <!-- child controls -->  
        </DynamicItemTemplate>  
        <DynamicMenuItemStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|  
                Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            ItemSpacing="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
        <DynamicMenuStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|  
                Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
        <DynamicSelectedStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|  
                Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            ItemSpacing="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
        <Items />  
        <LevelMenuItemStyles>  
                <asp:MenuItemStyle  
                    BackColor="color name|#dddddd"  
                    BorderColor="color name|#dddddd"  
                    BorderStyle="NotSet|None|Dotted|Dashed|Solid|  
                        Double|Groove|Ridge|Inset|Outset"  
                    BorderWidth="size"  
                    CssClass="string"  
                    Font-Bold="True|False"  
                    Font-Italic="True|False"  
                    Font-Names="string"  
                    Font-Overline="True|False"  
                    Font-Size="string|Smaller|Larger|XX-Small|  
                        X-Small|Small|Medium|Large|X-Large|XX-Large"  
                    Font-Strikeout="True|False"  
                    Font-Underline="True|False"  
                    ForeColor="color name|#dddddd"  
                    Height="size"  
                    HorizontalPadding="size"  
                    ItemSpacing="size"  
                    OnDisposed="Disposed event handler"  
                    VerticalPadding="size"  
                    Width="size"  
                />  
        </LevelMenuItemStyles>  
        <LevelSelectedStyles>  
                <asp:MenuItemStyle  
                    BackColor="color name|#dddddd"  
                    BorderColor="color name|#dddddd"  
                    BorderStyle="NotSet|None|Dotted|Dashed|Solid|  
                        Double|Groove|Ridge|Inset|Outset"  
                    BorderWidth="size"  
                    CssClass="string"  
                    Font-Bold="True|False"  
                    Font-Italic="True|False"  
                    Font-Names="string"  
                    Font-Overline="True|False"  
                    Font-Size="string|Smaller|Larger|XX-Small|  
                        X-Small|Small|Medium|Large|X-Large|XX-Large"  
                    Font-Strikeout="True|False"  
                    Font-Underline="True|False"  
                    ForeColor="color name|#dddddd"  
                    Height="size"  
                    HorizontalPadding="size"  
                    ItemSpacing="size"  
                    OnDisposed="Disposed event handler"  
                    VerticalPadding="size"  
                    Width="size"  
                />  
        </LevelSelectedStyles>  
        <LevelSubMenuStyles>  
                <asp:SubMenuStyle  
                    BackColor="color name|#dddddd"  
                    BorderColor="color name|#dddddd"  
                    BorderStyle="NotSet|None|Dotted|Dashed|Solid|  
                        Double|Groove|Ridge|Inset|Outset"  
                    BorderWidth="size"  
                    CssClass="string"  
                    Font-Bold="True|False"  
                    Font-Italic="True|False"  
                    Font-Names="string"  
                    Font-Overline="True|False"  
                    Font-Size="string|Smaller|Larger|XX-Small|  
                        X-Small|Small|Medium|Large|X-Large|XX-Large"  
                    Font-Strikeout="True|False"  
                    Font-Underline="True|False"  
                    ForeColor="color name|#dddddd"  
                    Height="size"  
                    HorizontalPadding="size"  
                    OnDisposed="Disposed event handler"  
                    VerticalPadding="size"  
                    Width="size"  
                />  
        </LevelSubMenuStyles>  
        <StaticHoverStyle />  
        <StaticItemTemplate>  
            <!-- child controls -->  
        </StaticItemTemplate>  
        <StaticMenuItemStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|  
                X-Small|Small|Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            ItemSpacing="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
        <StaticMenuStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|  
                Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
        <StaticSelectedStyle  
            BackColor="color name|#dddddd"  
            BorderColor="color name|#dddddd"  
            BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|  
                Groove|Ridge|Inset|Outset"  
            BorderWidth="size"  
            CssClass="string"  
            Font-Bold="True|False"  
            Font-Italic="True|False"  
            Font-Names="string"  
            Font-Overline="True|False"  
            Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|  
                Medium|Large|X-Large|XX-Large"  
            Font-Strikeout="True|False"  
            Font-Underline="True|False"  
            ForeColor="color name|#dddddd"  
            Height="size"  
            HorizontalPadding="size"  
            ItemSpacing="size"  
            OnDisposed="Disposed event handler"  
            VerticalPadding="size"  
            Width="size"  
        />  
</asp:Menu>  

Constructors

Menu()

Initializes a new instance of the Menu class.

Fields

MenuItemClickCommandName

Contains the command name.

Properties

AccessKey

Gets or sets the access key that allows you to quickly navigate to the Web server control.

(Inherited from WebControl)
Adapter

Gets the browser-specific adapter for the control.

(Inherited from Control)
AppRelativeTemplateSourceDirectory

Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(Inherited from Control)
Attributes

Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

(Inherited from WebControl)
BackColor

Gets or sets the background color of the Web server control.

(Inherited from WebControl)
BindingContainer

Gets the control that contains this control's data binding.

(Inherited from Control)
BorderColor

Gets or sets the border color of the Web control.

(Inherited from WebControl)
BorderStyle

Gets or sets the border style of the Web server control.

(Inherited from WebControl)
BorderWidth

Gets or sets the border width of the Web server control.

(Inherited from WebControl)
ChildControlsCreated

Gets a value that indicates whether the server control's child controls have been created.

(Inherited from Control)
ClientID

Gets the control ID for HTML markup that is generated by ASP.NET.

(Inherited from Control)
ClientIDMode

Gets or sets the algorithm that is used to generate the value of the ClientID property.

(Inherited from Control)
ClientIDSeparator

Gets a character value representing the separator character used in the ClientID property.

(Inherited from Control)
Context

Gets the HttpContext object associated with the server control for the current Web request.

(Inherited from Control)
Controls

Gets a ControlCollection that contains the child controls of the Menu control.

ControlStyle

Gets the style of the Web server control. This property is used primarily by control developers.

(Inherited from WebControl)
ControlStyleCreated

Gets a value indicating whether a Style object has been created for the ControlStyle property. This property is primarily used by control developers.

(Inherited from WebControl)
CssClass

Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

(Inherited from WebControl)
DataBindings

Gets a collection of MenuItemBinding objects that define the relationship between a data item and the menu item it is binding to.

DataItemContainer

Gets a reference to the naming container if the naming container implements IDataItemContainer.

(Inherited from Control)
DataKeysContainer

Gets a reference to the naming container if the naming container implements IDataKeysControl.

(Inherited from Control)
DataSource

Gets or sets the object from which the data-bound control retrieves its list of data items.

(Inherited from BaseDataBoundControl)
DataSourceID

Gets or sets the ID of the control from which the data-bound control retrieves its list of data items.

(Inherited from HierarchicalDataBoundControl)
DesignMode

Gets a value indicating whether a control is being used on a design surface.

(Inherited from Control)
DisappearAfter

Gets or sets the duration for which a dynamic menu is displayed after the mouse pointer is no longer positioned over the menu.

DynamicBottomSeparatorImageUrl

Gets or sets the URL to an image to display at the bottom of each dynamic menu item to separate it from other menu items.

DynamicEnableDefaultPopOutImage

Gets or sets a value indicating whether the built-in image that indicates that a dynamic menu item has a submenu is displayed.

DynamicHorizontalOffset

Gets or sets the number of pixels to shift a dynamic menu horizontally relative to its parent menu item.

DynamicHoverStyle

Gets a reference to the Style object that allows you to set the appearance of a dynamic menu item when the mouse pointer is positioned over it.

DynamicItemFormatString

Gets or sets additional text shown with all menu items that are dynamically displayed.

DynamicItemTemplate

Gets or sets the template that contains the custom content to render for a dynamic menu.

DynamicMenuItemStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of the menu items within a dynamic menu.

DynamicMenuStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of a dynamic menu.

DynamicPopOutImageTextFormatString

Gets or sets the alternate text for the image used to indicate that a dynamic menu item has a submenu.

DynamicPopOutImageUrl

Gets or sets the URL to a custom image that is displayed in a dynamic menu item when the dynamic menu item has a submenu.

DynamicSelectedStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of the dynamic menu item selected by the user.

DynamicTopSeparatorImageUrl

Gets or sets the URL to an image to display at the top of each dynamic menu item to separate it from other menu items.

DynamicVerticalOffset

Gets or sets the number of pixels to shift a dynamic menu vertically relative to its parent menu item.

Enabled

Gets or sets a value indicating whether the Web server control is enabled.

(Inherited from WebControl)
EnableTheming

Gets or sets a value indicating whether themes apply to this control.

(Inherited from WebControl)
EnableViewState

Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(Inherited from Control)
Events

Gets a list of event handler delegates for the control. This property is read-only.

(Inherited from Control)
Font

Gets the font properties associated with the Web server control.

(Inherited from WebControl)
ForeColor

Gets or sets the foreground color (typically the color of the text) of the Web server control.

(Inherited from WebControl)
HasAttributes

Gets a value indicating whether the control has attributes set.

(Inherited from WebControl)
HasChildViewState

Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(Inherited from Control)
Height

Gets or sets the height of the Web server control.

(Inherited from WebControl)
ID

Gets or sets the programmatic identifier assigned to the server control.

(Inherited from Control)
IdSeparator

Gets the character used to separate control identifiers.

(Inherited from Control)
IncludeStyleBlock

Gets or sets a value that indicates whether ASP.NET should render a block of cascading style sheet (CSS) definitions for the styles that are used in the menu.

Initialized

Gets a value indicating whether the data-bound control has been initialized.

(Inherited from BaseDataBoundControl)
IsBoundUsingDataSourceID

Gets a value indicating whether the DataSourceID property is set.

(Inherited from BaseDataBoundControl)
IsChildControlStateCleared

Gets a value indicating whether controls contained within this control have control state.

(Inherited from Control)
IsDataBindingAutomatic

Gets a value that indicates whether data binding is automatic.

(Inherited from BaseDataBoundControl)
IsEnabled

Gets a value indicating whether the control is enabled.

(Inherited from WebControl)
IsTrackingViewState

Gets a value that indicates whether the server control is saving changes to its view state.

(Inherited from Control)
IsUsingModelBinders

When implemented in a derived class, gets a value that indicates whether the control is using model binders.

(Inherited from BaseDataBoundControl)
IsViewStateEnabled

Gets a value indicating whether view state is enabled for this control.

(Inherited from Control)
Items

Gets a MenuItemCollection object that contains all menu items in the Menu control.

ItemWrap

Gets or sets a value indicating whether the text for menu items should wrap.

LevelMenuItemStyles

Gets a MenuItemStyleCollection object that contains the style settings that are applied to menu items based on their level in a Menu control.

LevelSelectedStyles

Gets a MenuItemStyleCollection object that contains the style settings that are applied to the selected menu item based on its level in a Menu control.

LevelSubMenuStyles

Gets a MenuItemStyleCollection object that contains the style settings that are applied to the submenu items in the static menu based on their level in a Menu control.

LoadViewStateByID

Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(Inherited from Control)
MaximumDynamicDisplayLevels

Gets or sets the number of menu levels to render for a dynamic menu.

NamingContainer

Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(Inherited from Control)
Orientation

Gets or sets the direction in which to render the Menu control.

Page

Gets a reference to the Page instance that contains the server control.

(Inherited from Control)
Parent

Gets a reference to the server control's parent control in the page control hierarchy.

(Inherited from Control)
PathSeparator

Gets or sets the character used to delimit the path of a menu item in a Menu control.

RenderingCompatibility

Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(Inherited from Control)
RenderingMode

Gets or sets a value that specifies whether the Menu control renders HTML table elements and inline styles, or listitem elements and cascading style sheet (CSS) styles.

RequiresDataBinding

Gets or sets a value indicating whether the DataBind() method should be called.

(Inherited from BaseDataBoundControl)
ScrollDownImageUrl

Gets or sets the URL to an image displayed in a dynamic menu to indicate that the user can scroll down for additional menu items.

ScrollDownText

Gets or sets the alternate text for the image specified in the ScrollDownImageUrl property.

ScrollUpImageUrl

Gets or sets the URL to an image displayed in a dynamic menu to indicate that the user can scroll up for additional menu items.

ScrollUpText

Gets or sets the alternate text for the image specified in the ScrollUpImageUrl property.

SelectedItem

Gets the selected menu item.

SelectedValue

Gets the value of the selected menu item.

Site

Gets information about the container that hosts the current control when rendered on a design surface.

(Inherited from Control)
SkinID

Gets or sets the skin to apply to the control.

(Inherited from WebControl)
SkipLinkText

Gets or sets the alternate text for a hidden image read by screen readers to provide the ability to skip the list of links.

StaticBottomSeparatorImageUrl

Gets or sets the URL to an image displayed as the separator at the bottom of each static menu item.

StaticDisplayLevels

Gets or sets the number of menu levels to display in a static menu.

StaticEnableDefaultPopOutImage

Gets or sets a value indicating whether the built-in image is displayed to indicate that a static menu item has a submenu.

StaticHoverStyle

Gets a reference to the Style object that allows you to set the appearance of a static menu item when the mouse pointer is positioned over it.

StaticItemFormatString

Gets or sets additional text shown with all menu items that are statically displayed.

StaticItemTemplate

Gets or sets the template that contains the custom content to render for a static menu.

StaticMenuItemStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of the menu items in a static menu.

StaticMenuStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of a static menu.

StaticPopOutImageTextFormatString

Gets or sets the alternate text for the pop-out image used to indicate that a static menu item has a submenu.

StaticPopOutImageUrl

Gets or sets the URL to an image displayed to indicate that a static menu item has a submenu.

StaticSelectedStyle

Gets a reference to the MenuItemStyle object that allows you to set the appearance of the menu item selected by the user in a static menu.

StaticSubMenuIndent

Gets or sets the amount of space, in pixels, to indent submenus within a static menu.

StaticTopSeparatorImageUrl

Gets or sets the URL to an image displayed as the separator at the top of each static menu item.

Style

Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

(Inherited from WebControl)
SupportsDisabledAttribute

Gets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false.

(Inherited from BaseDataBoundControl)
TabIndex

Gets or sets the tab index of the Web server control.

(Inherited from WebControl)
TagKey

Gets the HtmlTextWriterTag value that corresponds to a Menu control. This property is used primarily by control developers.

TagName

Gets the name of the control tag. This property is used primarily by control developers.

(Inherited from WebControl)
Target

Gets or sets the target window or frame in which to display the Web page content associated with a menu item.

TemplateControl

Gets or sets a reference to the template that contains this control.

(Inherited from Control)
TemplateSourceDirectory

Gets the virtual directory of the Page or UserControl that contains the current server control.

(Inherited from Control)
ToolTip

Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

(Inherited from WebControl)
UniqueID

Gets the unique, hierarchically qualified identifier for the server control.

(Inherited from Control)
ValidateRequestMode

Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(Inherited from Control)
ViewState

Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(Inherited from Control)
ViewStateIgnoresCase

Gets a value that indicates whether the StateBag object is case-insensitive.

(Inherited from Control)
ViewStateMode

Gets or sets the view-state mode of this control.

(Inherited from Control)
Visible

Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(Inherited from Control)
Width

Gets or sets the width of the Web server control.

(Inherited from WebControl)

Methods

AddAttributesToRender(HtmlTextWriter)

Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriter object.

AddedControl(Control, Int32)

Called after a child control is added to the Controls collection of the Control object.

(Inherited from Control)
AddParsedSubObject(Object)

Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(Inherited from Control)
ApplyStyle(Style)

Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. This method is primarily used by control developers.

(Inherited from WebControl)
ApplyStyleSheetSkin(Page)

Applies the style properties defined in the page style sheet to the control.

(Inherited from Control)
BeginRenderTracing(TextWriter, Object)

Begins design-time tracing of rendering data.

(Inherited from Control)
BuildProfileTree(String, Boolean)

Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(Inherited from Control)
ClearCachedClientID()

Sets the cached ClientID value to null.

(Inherited from Control)
ClearChildControlState()

Deletes the control-state information for the server control's child controls.

(Inherited from Control)
ClearChildState()

Deletes the view-state and control-state information for all the server control's child controls.

(Inherited from Control)
ClearChildViewState()

Deletes the view-state information for all the server control's child controls.

(Inherited from Control)
ClearEffectiveClientIDMode()

Sets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(Inherited from Control)
ConfirmInitState()

Sets the initialized state of the data-bound control.

(Inherited from BaseDataBoundControl)
CopyBaseAttributes(WebControl)

Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. This method is used primarily by control developers.

(Inherited from WebControl)
CreateChildControls()

Creates the child controls of a Menu control.

CreateControlCollection()

Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control.

(Inherited from Control)
CreateControlStyle()

Creates the style object that is used internally by the WebControl class to implement all style related properties. This method is used primarily by control developers.

(Inherited from WebControl)
DataBind()

Binds the data source to the Menu control. This method cannot be inherited.

DataBind(Boolean)

Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(Inherited from Control)
DataBindChildren()

Binds a data source to the server control's child controls.

(Inherited from Control)
Dispose()

Enables a server control to perform final clean up before it is released from memory.

(Inherited from Control)
EndRenderTracing(TextWriter, Object)

Ends design-time tracing of rendering data.

(Inherited from Control)
EnsureChildControls()

Determines whether the server control contains child controls. If it does not, it creates child controls.

(Inherited from Control)
EnsureDataBound()

Verifies that the menu control requires data binding and that a valid data source control is specified before calling the DataBind() method.

EnsureID()

Creates an identifier for controls that do not have an identifier assigned.

(Inherited from Control)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindControl(String, Int32)

Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method.

(Inherited from Control)
FindControl(String)

Searches the current naming container for a server control with the specified id parameter.

(Inherited from Control)
FindItem(String)

Retrieves the menu item at the specified value path.

Focus()

Sets input focus to a control.

(Inherited from Control)
GetData(String)

Retrieves a HierarchicalDataSourceView object that the data-bound control uses to perform data operations.

(Inherited from HierarchicalDataBoundControl)
GetDataSource()

Retrieves the IHierarchicalDataSource that the data-bound control is associated with, if any.

(Inherited from HierarchicalDataBoundControl)
GetDesignModeState()

Retrieves the design-time state of the Menu control.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRouteUrl(Object)

Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(RouteValueDictionary)

Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(String, Object)

Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetRouteUrl(String, RouteValueDictionary)

Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUniqueIDRelativeTo(Control)

Returns the prefixed portion of the UniqueID property of the specified control.

(Inherited from Control)
HasControls()

Determines if the server control contains any child controls.

(Inherited from Control)
HasEvents()

Returns a value indicating whether events are registered for the control or any child controls.

(Inherited from Control)
IsLiteralContent()

Determines if the server control holds only literal content.

(Inherited from Control)
LoadControlState(Object)

Loads the state of the properties in the Menu control that need to be persisted.

LoadViewState(Object)

Loads the previously saved view state of the Menu control.

MapPathSecure(String)

Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(Inherited from Control)
MarkAsDataBound()

Sets the state of the control in view state as successfully bound to data.

(Inherited from HierarchicalDataBoundControl)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MergeStyle(Style)

Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. This method is used primarily by control developers.

(Inherited from WebControl)
OnBubbleEvent(Object, EventArgs)

Determines whether the event for the Menu control is passed up the page's user interface (UI) server control hierarchy.

OnDataBinding(EventArgs)

Raises the DataBinding event.

OnDataBound(EventArgs)

Raises the DataBound event.

(Inherited from BaseDataBoundControl)
OnDataPropertyChanged()

Called when one of the base data source identification properties is changed, to re-bind the data-bound control to its data.

(Inherited from HierarchicalDataBoundControl)
OnDataSourceChanged(Object, EventArgs)

Called when the IHierarchicalDataSource instance that the data-bound control works with raises the DataSourceChanged event.

(Inherited from HierarchicalDataBoundControl)
OnInit(EventArgs)

Raises the Init event.

OnLoad(EventArgs)

Handles the Load event.

(Inherited from HierarchicalDataBoundControl)
OnMenuItemClick(MenuEventArgs)

Raises the MenuItemClick event.

OnMenuItemDataBound(MenuEventArgs)

Raises the MenuItemDataBound event.

OnPagePreLoad(Object, EventArgs)

Sets the initialized state of the data-bound control before the control is loaded.

(Inherited from HierarchicalDataBoundControl)
OnPreRender(EventArgs)

Raises the PreRender event.

OnUnload(EventArgs)

Raises the Unload event.

(Inherited from Control)
OpenFile(String)

Gets a Stream used to read a file.

(Inherited from Control)
PerformDataBinding()

Binds the items from the data source to the menu items in the Menu control.

PerformSelect()

Retrieves data from the associated data source.

(Inherited from HierarchicalDataBoundControl)
RaiseBubbleEvent(Object, EventArgs)

Assigns any sources of the event and its information to the control's parent.

(Inherited from Control)
RaisePostBackEvent(String)

Processes an event raised when a form is posted to the server.

RemovedControl(Control)

Called after a child control is removed from the Controls collection of the Control object.

(Inherited from Control)
Render(HtmlTextWriter)

Renders the menu control on the client browser.

RenderBeginTag(HtmlTextWriter)

Adds tag attributes and writes the markup for the opening tag of the control to the output stream emitted to the browser or device.

RenderChildren(HtmlTextWriter)

Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(Inherited from Control)
RenderContents(HtmlTextWriter)

This member overrides RenderContents(HtmlTextWriter).

RenderControl(HtmlTextWriter, ControlAdapter)

Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(Inherited from Control)
RenderControl(HtmlTextWriter)

Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(Inherited from Control)
RenderEndTag(HtmlTextWriter)

Performs final markup and writes the HTML closing tag of the control to the output stream emitted to the browser or device.

ResolveAdapter()

Gets the control adapter responsible for rendering the specified control.

(Inherited from Control)
ResolveClientUrl(String)

Gets a URL that can be used by the browser.

(Inherited from Control)
ResolveUrl(String)

Converts a URL into one that is usable on the requesting client.

(Inherited from Control)
SaveControlState()

Saves the state of the properties in the Menu control that need to be persisted.

SaveViewState()

Saves the state of the Menu control.

SetDesignModeState(IDictionary)

Sets design-time data for the Menu control.

SetItemDataBound(MenuItem, Boolean)

Sets the DataBound property of the specified MenuItem object with the specified value.

SetItemDataItem(MenuItem, Object)

Sets the DataItem property of the specified MenuItem object with the specified value.

SetItemDataPath(MenuItem, String)

Sets the DataPath property of the specified MenuItem object with the specified value.

SetRenderMethodDelegate(RenderMethod)

Assigns an event handler delegate to render the server control and its content into its parent control.

(Inherited from Control)
SetTraceData(Object, Object, Object)

Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(Inherited from Control)
SetTraceData(Object, Object)

Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(Inherited from Control)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState()

Tracks view-state changes to the Menu control so they can be stored in the control's StateBag object. This object is accessible through the ViewState property.

ValidateDataSource(Object)

Verifies that the object a data-bound control binds to is one it can work with.

(Inherited from HierarchicalDataBoundControl)

Events

DataBinding

Occurs when the server control binds to a data source.

(Inherited from Control)
DataBound

Occurs after the server control binds to a data source.

(Inherited from BaseDataBoundControl)
Disposed

Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(Inherited from Control)
Init

Occurs when the server control is initialized, which is the first step in its lifecycle.

(Inherited from Control)
Load

Occurs when the server control is loaded into the Page object.

(Inherited from Control)
MenuItemClick

Occurs when a menu item in a Menu control is clicked.

MenuItemDataBound

Occurs when a menu item in a Menu control is bound to data.

PreRender

Occurs after the Control object is loaded but prior to rendering.

(Inherited from Control)
Unload

Occurs when the server control is unloaded from memory.

(Inherited from Control)

Explicit Interface Implementations

IAttributeAccessor.GetAttribute(String)

Gets an attribute of the Web control with the specified name.

(Inherited from WebControl)
IAttributeAccessor.SetAttribute(String, String)

Sets an attribute of the Web control to the specified name and value.

(Inherited from WebControl)
IControlBuilderAccessor.ControlBuilder

For a description of this member, see ControlBuilder.

(Inherited from Control)
IControlDesignerAccessor.GetDesignModeState()

For a description of this member, see GetDesignModeState().

(Inherited from Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

For a description of this member, see SetDesignModeState(IDictionary).

(Inherited from Control)
IControlDesignerAccessor.SetOwnerControl(Control)

For a description of this member, see SetOwnerControl(Control).

(Inherited from Control)
IControlDesignerAccessor.UserData

For a description of this member, see UserData.

(Inherited from Control)
IDataBindingsAccessor.DataBindings

For a description of this member, see DataBindings.

(Inherited from Control)
IDataBindingsAccessor.HasDataBindings

For a description of this member, see HasDataBindings.

(Inherited from Control)
IExpressionsAccessor.Expressions

For a description of this member, see Expressions.

(Inherited from Control)
IExpressionsAccessor.HasExpressions

For a description of this member, see HasExpressions.

(Inherited from Control)
IParserAccessor.AddParsedSubObject(Object)

For a description of this member, see AddParsedSubObject(Object).

(Inherited from Control)
IPostBackEventHandler.RaisePostBackEvent(String)

Processes an event raised when a form is posted to the server.

Extension Methods

EnablePersistedSelection(BaseDataBoundControl)
Obsolete.

Enables selection to be persisted in data controls that support selection and paging.

FindDataSourceControl(Control)

Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String)

Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control)

Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer)

Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer)

Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object)

Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable)

Sets the table metadata for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable)

Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object)

Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type)

Enables Dynamic Data behavior for the specified data control.

Applies to

See also