System.Web.UI Namespace ControlCollection Class
Returns a reference to the server control at the specified index location in a ControlCollection.
Control variable = Controls.Item [ index ];
... or ...
Control variable = Controls [ index ];
dim variable as Control = Controls.Item ( index )
... or ...
dim variable as Control = Controls ( index )
variable : Control = Controls.Item ( index );
... or ...
variable : Control = Controls ( index ); |
|
C# |
VB |
JScript |
- index
- An integer specifying the position of the item in the collection.
The Control at the specified index.
Use this indexer to get a Control from the ControlCollection. You can access a Control at a specified index by using simple array notation.
For example, if you have a ControlCollection called myControls, you can access the first element in the collection by using the following statement:
Control myControl = myControls.Item [ 0 ];
... or ...
Control myControl = myControls [ 0 ];
dim myControl as Control = myControls.Item ( 0 )
... or ...
dim myControl as Control = myControls ( 0 )
myControl : Control = myControls.Item ( 0 );
... or ...
myControl : Control = myControls ( 0 ); |
|
C# |
VB |
JScript |
NOTE: The collection is zero-based, meaning the first element in the collection returns an index value of 0.
ControlCollection Members