Page.Validators 属性

定义

获取请求的页上包含的全部验证控件的集合。Gets a collection of all validation controls contained on the requested page.

public:
 property System::Web::UI::ValidatorCollection ^ Validators { System::Web::UI::ValidatorCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
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.

属性

注解

您可以使用此属性来操作与当前 Page 实例相关联的 ValidatorCollection 对象的方法和属性。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.

适用于

另请参阅