System.Web.UI.WebControls.SubMenuStyleCollection.Insert Method

Inserts a System.Web.UI.WebControls.SubMenuStyle object into the System.Web.UI.WebControls.SubMenuStyleCollection collection at the specified index.

Syntax

public void Insert (int index, SubMenuStyle style)

Parameters

index
The zero-based index at which the System.Web.UI.WebControls.SubMenuStyle object should be inserted.
style
The System.Web.UI.WebControls.SubMenuStyle object to insert into the System.Web.UI.WebControls.SubMenuStyleCollection collection.

Remarks

If index is -1, style is inserted at the beginning of the System.Web.UI.WebControls.SubMenuStyleCollection collection. If index equals the number of items in the collection, style is appended to the end of the System.Web.UI.WebControls.SubMenuStyleCollection collection.

The System.Web.UI.StateManagedCollection.OnValidate(object) method is called to validate the style parameter before it is added to the collection. The SubMenuStyleCollection.OnInsert(int, object) method is called before the System.Web.UI.WebControls.SubMenuStyle object is inserted into the collection, and the System.Web.UI.StateManagedCollection.OnInsertComplete(int, object) method is called after the object is inserted.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0