ValidatorCollection.CopyTo Method (Array, Int32)
.NET Framework (current version)
Copies the validator collection to the specified array, beginning at the specified location.
Assembly: System.Web (in System.Web.dll)
Parameters
- array
-
Type:
System.Array
The collection to which the validation server control is added.
- index
-
Type:
System.Int32
The index where the validation server control is copied.
Implements
ICollection.CopyTo(Array, Int32)The following code example demonstrates using the CopyTo method.
// Get 'Validators' of the page to myCollection. ValidatorCollection myCollection = Page.Validators ; // Object Array. Object[] myObjArray = new Object[5] { 0, 0, 0, 0, 0 }; // Copy the 'Collection' to 'Array'. myCollection.CopyTo(myObjArray,0); // Print the values in the Array. string myStr = " "; for(int i = 0; i<myCollection.Count; i++) { myStr += myObjArray[i].ToString(); myStr += " "; } msgLabel.Text = myStr;
.NET Framework
Available since 1.1
Available since 1.1
Show: