asp.net.ph

Menu.Items Property

System.Web.UI.WebControls Namespace   Menu Class


.NET Framework version 2.0

Returns a collection of MenuItem objects that represents the root menu items in a Menu control.

Syntax


Script [ MenuItemCollection variable = ] Menu.Items

Property Value


variable Returns a MenuItemCollection that contains the root menu items in a Menu.

The property is read/write with no default value.

Remarks

Use the Items collection to programmatically obtain information about each root menu item in a Menu control. This collection is typically used to iterate through all the root menu items, or to access a specific root menu item.

The Items property can also be used to programmatically add, insert, or remove MenuItem objects in the collection. Any updates to the collection are automatically reflected in the Menu control after the next round trip to the server.

To access the child menu items of a root or parent menu item, use the ChildItems property of the menu item ( or the subsequent parent-level menu item ) to navigate down the menu hierarchy.

Example

The following example shows how to programmatically add MenuItem objects to the Items collection of a Menu control.

MenuItem newItem = new MenuItem ( menuItemText, menuItemValue );
newItem.NavigateUrl = webPageUrl;
menuObject.Items.Add ( newItem );

 Show me 

See Also

Menu Members   MenuItemSkip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph