Returns an enumerator that can be used to iterate through the items in the current System.Web.UI.WebControls.MenuItemCollection object.
An enumerator that can be used to iterate through the items in the current System.Web.UI.WebControls.MenuItemCollection.
Use the MenuItemCollection.GetEnumerator method to create an enumerator that can be easily iterated through to get each item in the current System.Web.UI.WebControls.MenuItemCollection object. To get the item currently pointed to in the enumerator, use the IEnumerator.Current property. Use the IEnumerator.MoveNext method to move to the next item. If you need to move the enumerator back to the beginning of the collection, use the IEnumerator.Reset method.
After you create an enumerator or use the IEnumerator.Reset method, you must call the IEnumerator.MoveNext method. Otherwise, the item represented by the IEnumerator.Current property is undefined.
As an alternative, you can also use the erload:System.Web.UI.WebControls.MenuItemCollection.CopyTo method to copy the items in the collection to an array. You can then use the array to access the items in the collection.