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 false屬性會傳回。If 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.