Menu.Items Property

Note: This property is new in the .NET Framework version 2.0.

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

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

property MenuItemCollection^ Items {
	MenuItemCollection^ get ();
/** @property */
public MenuItemCollection get_Items ()

public function get Items () : MenuItemCollection

Property Value

A MenuItemCollection that contains all menu items in the Menu control.

Use the Items property (collection) to get a MenuItemCollection object that contains all the menu items in a Menu control. This collection is commonly used to quickly iterate through all the menu items, or to access a specific menu item.

The Items collection can also be used to programmatically manage the menu items. You can add, insert, remove, and retrieve MenuItem collection objects. Any updates to the collection will automatically be reflected in the Menu control after the next round trip to the server.

The following code example demonstrates how to use the Items collection to traverse the menu items in the Menu control.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions