Webform server controls and client controls, and validation controls

Source: Internet
Author: User

webform--server controls are Webform with client controls, that is, BS, browser apps. With regard to servers and clients, in WebForm, the server is equivalent to the background (that is, where the C # code is edited) and the client is the foreground (that is, the HTML page). Usage: ① If you want to invoke the JS or jquery function of a client control in a server control, you must add the OnClientClick property to the server's control, <asp:button id= "Button1" runat= "Server" Onclientclick= "Tanchu ()" onclick= "Button1_Click" text= "button"/>

Run the sequence, run JS or jquery first, and then run C #

  

Validation control is generally used at the time of registration, is to directly encapsulate the JS code into the control, pull over directly can be used, the following introduction to the main usage: 1, CompareValidator: Comparative Validation Common properties: ControlToCompare The idcontroltovalidate of the control that is used to compare the ID of the control that is being validated displays the display validator (dynamic) errormessage when the validated control is invalid when it is displayed in ValidationSummary Message ValidationGroup whether the group to which the validator belongs is visible 2, RangeValidator: Range Validation Common properties: ControlToValidate the Idmaximumvalue range maximum value of the control to validate Minim Umvalue Range min Display validator (dynamic) errormessage The message that is displayed in ValidationSummary when the validated control is invalid ValidationGroup the group V that the validator belongs to Isible is visible 3, regularexpressionvalidator Regular expression validation Common properties: ControlToValidate the idvalidationexpression of the control to validate to determine the validity of the regular expression D Isplay how the validator is displayed (dynamic) errormessage The message that is displayed in ValidationSummary when the validated control is invalid ValidationGroup the group to which the validator belongs is visible 4, RequiredFieldValidator non-null validation Common properties: ControlToValidate the ID of the control to be validated displays the display validator (dynamic) errormessage when the validated control is invalid in V The message displayed in Alidationsummary ValidationGroup the group to which the validator belongs is visible 5, validationsummary error message Summary Common properties: ValidationGroup Verify that the group to which the program belongs is visible 6, CustomValidator: User-defined validation Common properties: ClientvalidatioThe Nfunction client Script validation feature controltovalidate the ID of the control to validate display validator (dynamic) errormessage when the validated control is not valid in Validationsumma The message displayed in Ry ValidationGroup whether the group to which the validator belongs is visible

Source: http://www.cnblogs.com/lk-kk/p/4652444.html

Webform server controls and client controls, and validation controls

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.