SubMenuStyleCollection::Insert Method
Inserts a SubMenuStyle object into the SubMenuStyleCollection collection at the specified index.
Assembly: System.Web (in System.Web.dll)
Parameters
- index
- Type: System::Int32
The zero-based index at which the SubMenuStyle object should be inserted.
- style
- Type: System.Web.UI.WebControls::SubMenuStyle
The SubMenuStyle object to insert into the SubMenuStyleCollection collection.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The specified index is outside the range of the collection. |
| NotSupportedException | The SubMenuStyleCollection collection is read-only. |
| ArgumentNullException | The specified style is nullptr. |
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 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.