ValidatorCollection.Item Property (Int32)

 

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

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public IValidator this[
	int index
] { get; }

Parameters

index
Type: System.Int32

The index of the validator to return.

Property Value

Type: System.Web.UI.IValidator

The value of the specified validator.

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;        

.NET Framework
Available since 1.1
Return to top
Show: