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 the client control in the server control, you must add the OnClientClick attribute to the server's control;<asp:button id="Button1"runat="Server"onclientclick="Tanchu ()"OnClick="Button1_Click"text="Button"/><br>② If the client wants to invoke the server control's Click event, it must add runat to the client's control="Server"and OnServerClick. <input id="Button2"Type="Button"Value="Button"runat="Server"OnServerClick="Button1_Click"/> <br>Run the sequence, run JS or jquery first, and then run C #123456789Ten One A - - the - - - + - + A at - - - - - in - to + - the * $Panax Notoginseng - the + A the + - $ $ - - the -Wuyi the - Wu - About $ - - - A + the - $ the the the the - in the the About the the the + - theBayi the the - - the the thevalidation 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 describes the main usage:1, CompareValidator: Comparison validation Common properties: ControlToCompare the ID of the control used for comparison ControlToValidate the ID of the control to validate display validator (Dynam IC dynamic) errormessage message displayed in ValidationSummary when the validated control is invalid ValidationGroup whether the group to which the validator belongs is visible2, RangeValidator: Range Validation Common properties: ControlToValidate the ID of the control to validate MaximumValue range maximum MinimumValue range minimum Display validation The way the program is displayed (dynamic) errormessage The message that is displayed in ValidationSummary when the validated control is invalid ValidationGroup whether the group that the validator belongs to is visible3, RegularExpressionValidator Regular expression validation Common properties: ControlToValidate the ID of the control to validate validationexpression the regular expression used to determine validity Disp How the Lay validator is displayed (dynamic) errormessage the message displayed in ValidationSummary when the validated control is invalid ValidationGroup the group to which the validator belongs is visible4, RequiredFieldValidator non-null validation Common properties: ControlToValidate the ID of the control to validate display validator (dynamic) errormessage when validating The control is invalid when the message that is displayed in ValidationSummary ValidationGroup whether the group to which the validator belongs is visible5, validationsummary error message Rollup Common properties: ValidationGroup the group visible to which the validator belongs6, CustomValidator: User custom Validation Common properties: ClientValidationFunction client Script validation feature controltovalidate the ID of the control to validate display validator ErrorMessage (dynamic) the message displayed in ValidationSummary when the validated control is invalid ValidationGroup whether the group to which the validator belongs is visible

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.