Remember ASP.NET Validation Control (20041119)

xiaoxiao2021-03-06  69

The verification control here is to verify the input control (such as a text box) and display an error message when verifying fails. Contains the following

Several controls: Name function 1 CompareValidator and value 2 CustomValidator Define your own verification 3 RangevaliDator Check Range 4 RegularExpressionValidator matching mode 5 RequiredFieldValidator Requirements 6 Validationsummary Summary error

1. This control can be used to compare the user's input with a value of a constant value or other control. What type of comparison operator is determined

Comparison (less than, equal to, greater than, etc.). Generally use when passwords to enter the password again. 2. You can use this control to create a custom server and client verification code. Generally use the checkbox class control to use .3. Use this control to check if the user's input is between the specified upper and lower limits. You can check digital pairs, letters and date-dependent

The range is set. The boundary is expressed as a constant. 4. You can use this control to check if the input is matched to the modes defined by a regular expression. This verification type allows you to check

Character sequences such as social security numbers, email address, phone number, postal code, etc. in the character sequence. 5. You can use this control to ensure that the user will not skip an input. 6. This control displays all validation error summary of all validation controls on the page.

Summary: Verification is divided into two ways, namely the client and server. By default, only client authentication (want to shield as long as the button control

The CausesValidation property is set to false), the server verification needs to check the page.issalid property in the code. Practice

In the process, this is found that such a problem, if the page is directly submitted, except "Requirements Enter" verify the control, the other will not check, solve this

A problem method is to bind two verification controls on an input control, one is "Request Enter" control.

转载请注明原文地址:https://www.9cbs.com/read-89523.html

New Post(0)