MenuItem.ChildItems Property

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

Gets a MenuItemCollection object that contains the submenu items of the current menu item.

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

public:
property MenuItemCollection^ ChildItems {
	MenuItemCollection^ get ();
}
/** @property */
public MenuItemCollection get_ChildItems ()

public function get ChildItems () : MenuItemCollection

Property Value

A MenuItemCollection that contains the submenu items of the current menu item. The default is a null reference (Nothing in Visual Basic), which indicates that this menu item does not contain any submenu items.

Use the ChildItems property (collection) to access the submenu items of the current menu item, if any. This collection contains only the menu items at the next level. To access menu items further down the menu tree, use the ChildItems property of a subsequent menu item. If the ChildItems property is a null reference (Nothing in Visual Basic), the current menu does not have any submenu items.

The ChildItems property can also be used to programmatically manage the submenu items of the current menu item. You can add, insert, remove, retrieve, and modify MenuItem objects from the collection. Any updates to the collection will automatically be reflected in the Menu control the next time the page is refreshed.

The following code example demonstrates how to use the ChildItems property to traverse the menu items in a 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

ADD
Show: