1. required verification control requiredfieldvalidator
Syntax Rules: <asp Tutorial: requiredfieldvalidator
Id = "identifier"
Runat = "server"
Controltovalidate = "control identifier to be verified"
Errormessage = "error message">
</Asp: requiredfieldvalidator>
This control often verifies textbox, and is blank in response.
2. Range verification control rangevalidator
Syntax rule: <asp: rangevalidator
Id = "identifier"
Runat = "server"
Controltovalidate = "control identifier to be verified"
Errormessage = "error message"
Maximumvalue = "maximum"
Minimumvalue = "minimum"
Type = "compare value type">
</Asp: rangevalidator>
This control is often used to verify that the age and so on represent a range. Note that if no information is entered, the range-eye verification control will not perform verification.
3. Regular Expression verification control
Syntax Rules: <asp: regularexpressionvalidator
Id = "identifier"
Runat = "server"
Controltovalidate = "control identifier to be verified"
Errormessage = "error message"
Validationexpression = "Regular Expression">
</Asp: regularexpressionvalidator>
This control uses regular expressions for verification. The rules for regular expressions are complex. Next time I will write an article about this control. Common regular expressions are provided in vs2008.
4. Comparison and verification controls
Syntax Rules: <asp: comparevalidator
Id = "identifier"
Runat = "server"
Controltocompare = "control identifier to be compared"
Controltovalidate = "control identifier to be verified"
Errormessage = "error message"
Opterater = "comparison type">
</Asp: comparevalidator>
This control is used to compare whether the two passwords are the same.
5. Custom verification controls
Syntax rule: <asp: customvalidator
Id = "identifier"
Runat = "server"
Controltovalidate = "control identifier to be verified"
Errormessage = "error message"
Onservervalidate = "Verification Method">
</Asp: customvalidator>
This control is used to customize the methods to be verified.
6. Verify the total number of controls
Syntax Rules: <asp: validationsummary
Id = "identifier"
Runat = "server"
Displaymode = "display mode"
Headertext = "title"
Showmessagebox = "true/false" whether to bring up a window/>
This control aggregates error messages when many verification controls exist.
In the asp.net tutorial, there are six types of verification controls: mandatory verification controls, range verification controls, regular expression verification controls, comparison verification controls, user-defined verification controls, and total verification controls.