Export (0) Print
Expand All

SubMenuStyleCollection.Insert Method

Inserts a SubMenuStyle object into the SubMenuStyleCollection collection at the specified index.

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

public void Insert (
	int index,
	SubMenuStyle style
public void Insert (
	int index, 
	SubMenuStyle style
public function Insert (
	index : int, 
	style : SubMenuStyle
Not applicable.



The zero-based index at which the SubMenuStyle object should be inserted.


The SubMenuStyle object to insert into the SubMenuStyleCollection collection.

Exception typeCondition


The specified index is outside the range of the collection.


The SubMenuStyleCollection collection is read-only.


The specified style is a null reference (Nothing in Visual Basic).

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

The OnValidate method is called to validate the style parameter before it is added to the collection. The OnInsert method is called before the SubMenuStyle object is inserted into the collection, and the OnInsertComplete method is called after the object is inserted.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2014 Microsoft