What attribute must be set on a validator control for the validation to work ?

  1. Validate

  2. ValidateControl

  3. ControlToBind

  4. ControlToValidate


Correct Option: D

AI Explanation

To answer this question, you need to understand the purpose of a validator control in web development.

A validator control is used to validate user input on a web form. It checks whether the input matches certain criteria, such as a required field, a specific format, or a range of values. In order for the validation to work correctly, you need to specify the control that should be validated.

The correct attribute that must be set on a validator control for the validation to work is:

D) ControlToValidate

The ControlToValidate attribute is used to specify the ID of the control that needs to be validated. This attribute tells the validator control which input field to check for validation.

Option A) Validate - This option is incorrect because there is no attribute called "Validate" associated with a validator control. Option B) ValidateControl - This option is incorrect because there is no attribute called "ValidateControl" associated with a validator control. Option C) ControlToBind - This option is incorrect because there is no attribute called "ControlToBind" associated with a validator control.

Therefore, the correct answer is D) ControlToValidate. This attribute needs to be set on a validator control to specify the control that needs to be validated.

Find more quizzes: