MenuItemCollection::Clear Method ()

 

Removes all items from the current MenuItemCollection object.

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

public:
void Clear()

Use the Clear method to remove every MenuItem object from the current MenuItemCollection object.

System_CAPS_noteNote

To remove an individual node from the collection, consider using the Remove or the RemoveAt method.

The following code example demonstrates how to use the Clear method to remove all items from the Items collection of a 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: