Validator's continuing study
1) requiredfieldvalidator--detect whether there is input in the object control
The main properties are:
ControlToValidate
ErrorMessage
Display
Additional properties:
InitialValue
Description
The RequiredFieldValidator attribute value can be said to be the simplest of several verification spaces, and his three attributes are required for each of the following validation controls. There are: ControlToValidate used to match the validated control, errormessage to display the error message, display is the displayed mode, respectively, there are none,static,dynamic three of properties. None indicates that no information is printed on the page at the time of the error; Static indicates that he always occupies a quick place on the page ready to display the error message, dynamic Most human, select his result is only when the error message will appear prompts, generally only select this. Finally, since the three properties of ControlToValidate, ErrorMessage, and display are required for each validation control, I will no longer mention them in the introduction of other controls in the following introductions.
InitialValue can set an initial value in RequiredFieldValidator to determine whether the user has changed the value and generates an error message if the user submits the same value as the value. Cases:
<asp:requiredfieldvalidator id= "Reqval1" runat= "Server"
Controltovalidate= "Txtname"
Errormessage= "Please input your name"
Display= "Dynamic"
Initialvalue= "Jack" >
*
<asp:RequiredFieldValidator>
The control implements one validation and generates an error message if the information submitted in txtname is null or is Jack (a reserved value that can be for any programmer). The * between the tags represents the actual information directly on the page at the time of the error.
2) comparevalidator--The value of the control to compare
Main properties:
ControlToCompare
Operator
Description
ControlToCompare the name of the object to compare with the specified object. Operator is the operation method, the main is equal to, not equal to, greater than, less than, the default value is equal to. Personally, the value of these values is not significant, since his comparison of greater than less than is possible by the RangeValidator described below.
3) rangevalidator--Limit determination
Main properties:
MinimumValue
MaximumValue
Description
You can see at a glance that the maximum minimum value is no longer classified.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service