ControlCollection.AddAt Method
.NET Framework 3.0
Adds the specified Control object to the collection at the specified index location.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public void AddAt ( int index, Control child )
public function AddAt ( index : int, child : Control )
Not applicable.
Parameters
- index
The location in the array at which to add the child control.
- child
The Control to add to the collection.
| Exception type | Condition |
|---|---|
|
The child parameter does not specify a control. | |
|
The index parameter is less than zero or greater than the ControlCollection.Count property. | |
|
The ControlCollection is read-only. |
The following code example uses the AddAt method to create a new LiteralControl named ChildControl2 and add it to the myButton control's ControlCollection collection at the index location of 1.
Community Additions
ADD
Show: