Home » mcq » Visual basic » The . . . . . . . . validator is used to compare an entry with a constant value or the property stored in a control.
CompareValidator
RangeValidator
RequiredFieldValidator
ValidationSummary
Answer is Wrong!
Answer is Right!
The correct answer is: A. CompareValidator
A CompareValidator is a server-side control that validates the contents of a control against a constant value or the property stored in another control. It is used to ensure that the value entered by the user is within a specified range or matches a specified value.
The RangeValidator is used to
132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/>
Subscribe on YouTube
validate that a value is within a specified range. The RequiredFieldValidator is used to validate that a field is not empty. The ValidationSummary is used to display a list of all validation errors on a page.
Here is an example of how to use a CompareValidator:
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="The value in TextBox1 must be greater than 10." Operator="GreaterThan" Value="10" />
In this example, the CompareValidator will validate that the value entered in TextBox1 is greater than 10. If the value is not greater than 10, an error message will be displayed.