Menu.Items Property

 

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)

[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>]
member Items : MenuItemCollection with get

Property Value

Type: System.Web.UI.WebControls.MenuItemCollection

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.

.NET Framework
Available since 2.0
Return to top
Show: