ValidatorCollection.Item[Int32] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the validation server control at the specified index location in the ValidatorCollection collection.
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
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;
' 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
Applies to
See also
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา