ValidatorCollection.Item[Int32] プロパティ

定義

ValidatorCollection コレクションの指定したインデックス位置にある検証サーバー コントロールを取得します。

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

パラメーター

index
Int32

返される検証コントロールのインデックス。

プロパティ値

指定した検証コントロールの値。

次のコード例では、 プロパティの使用方法を Item[] 示します。

// 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

適用対象

こちらもご覧ください