次の方法で共有


ValidatorCollection.Item プロパティ

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

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public ReadOnly Default Property Item ( _
    index As Integer _
) As IValidator
'使用
Dim instance As ValidatorCollection
Dim index As Integer
Dim value As IValidator

value = instance(index)
public IValidator this [
    int index
] { get; }
public:
property IValidator^ default [int] {
    IValidator^ get (int index);
}
/** @property */
public IValidator get_Item (int index)
適用できません。

パラメータ

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

プロパティ値

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

使用例

Item プロパティを使用したコード例を次に示します。

' 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
// 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.
ValidatorCollection myCollection = get_Validators();

// Print the values of Collection using 'Item' property.
String myStr = " ";         
for(int i = 0; i<myCollection.get_Count(); i++) {
    myStr += System.Convert.ToString(myCollection.get_Item(i));
    myStr += " ";
}
msgLabel.set_Text(myStr);        

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

ValidatorCollection クラス
ValidatorCollection メンバ
System.Web.UI 名前空間
IValidator
Page.Validators プロパティ