ValidatorCollection.Item[Int32] Eigenschaft

Definition

Ruft das Überprüfungsserver-Steuerelement am angegebenen Indexspeicherort in der ValidatorCollection Auflistung ab.

public:
 property System::Web::UI::IValidator ^ default[int] { System::Web::UI::IValidator ^ get(int index); };
public System.Web.UI.IValidator this[int index] { get; }
member this.Item(int) : System.Web.UI.IValidator
Default Public ReadOnly Property Item(index As Integer) As IValidator

Parameter

index
Int32

Der Index des zurückzugebenden Validators.

Eigenschaftswert

Der Wert des angegebenen Validators.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der Item[] Eigenschaft veranschaulicht.

// 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;        
' Get 'Validators' of the page to myCollection.
Dim myCollection As ValidatorCollection = Page.Validators
' Print the values of Collection using 'Item' property.
Dim myStr As String = " "
Dim i As Integer
For i = 0 To myCollection.Count - 1
   myStr = mystr & CType(myCollection(i),BaseValidator).ToString() & "<br />"
Next i
msgLabel.Text = myStr

Gilt für:

Weitere Informationen