Page.Validators Page.Validators Page.Validators Page.Validators Property


取得被要求的網頁中所有包含的驗證控制項集合。Gets a collection of all validation controls contained on the requested page.

 property System::Web::UI::ValidatorCollection ^ Validators { System::Web::UI::ValidatorCollection ^ get(); };
public System.Web.UI.ValidatorCollection Validators { get; }
member this.Validators : System.Web.UI.ValidatorCollection
Public ReadOnly Property Validators As ValidatorCollection


驗證控制項的集合The collection of validation controls.


您可以使用這個屬性來操作的方法和屬性的ValidatorCollection目前相關聯的物件Page執行個體。You can use this property to manipulate the methods and properties of the ValidatorCollection object associated with the current Page instance. 此集合包含頁面中所包含的所有驗證伺服器控制項。This collection contains all the validation server controls that are contained in a page.

呼叫Page.Validate方法會導致目前的驗證群組中每個驗證伺服器控制項執行驗證邏輯。Calling the Page.Validate method causes validation logic to be executed for each validation server control in the current validation group. 如果未通過這些控制項的任何項目,請勿Page.IsValid屬性會傳回falseIf any of these controls do not pass, the Page.IsValid property returns false.

如需有關驗證控制項的詳細資訊,請參閱ASP.NET 驗證控制項For more information on validation controls, see ASP.NET Validation Controls.