ValidatorCollection.Item[Int32] Property

Definition

Gets the validation server control at the specified index location in the ValidatorCollection collection.

public System.Web.UI.IValidator this[int index] { get; }

Parameters

index
Int32

The index of the validator to return.

Property Value

The value of the specified validator.

Examples

The following code example demonstrates using the Item[] property.

// Get 'Validators' of the page to myCollection.
ValidatorCollection myCollection = Page.Validators;

// Print the values of Collection using 'Item' property.
string myStr = " ";         
for(int i = 0; i<myCollection.Count; i++)
{
   myStr += myCollection[i].ToString();
   myStr += " ";
}
msgLabel.Text = myStr;        

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also