Documentation for this section has not yet been entered.
Use the BaseValidator.ControlToValidate property to specify the input control to validate. This property must be set to the ID of an input control for all validation controls except the System.Web.UI.WebControls.CustomValidator control, which can be left blank. If you do not specify a valid input control, an exception will be thrown when the page is rendered. The ID must refer to a control within the same container as the validation control. It must be in the same page or user control, or it must be in the same template of a templated control.
The standard controls that can be validated are:
For an input control to be validated, the System.Web.UI.ValidationPropertyAttribute attribute must be applied to the control.
All validation controls, except the System.Web.UI.WebControls.RequiredFieldValidator control, will pass validation if the input control specified by the BaseValidator.ControlToValidate property contains no text. If you are usingĀ a System.Web.UI.WebControls.CustomValidator control, the client-side and server-side validation functions are not called either.
This property cannot be set by themes or style sheet themes. For more information, see System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.