Conceptual differences between ASP controls and HTML controls

Source: Internet
Author: User

This article mainly introduces the ASP control and HTML control conceptual differences, not clear friends can refer to the

First of all, let's talk about the difference between the two concepts (I believe we all know)

1. An ASP control is a server-side control, and HTML is a client control.

2. When the ASP control resolves at the server side, it translates into an HTML control that enables the client browser to be displayed. That means the final product is HTML control.

3. asp controls can only be resolved by installing the. NETFramework server, and HTML is java,php,asp.

So let's say the difference between the two functions

1. The ASP control must be submitted by the page (unless forced to cancel, see 2.), and HTML controls can be committed or not committed (set by the Type property)

2. asp control onclick and OnClientClick difference: OnClientClick Execution Client Event response (by JavaScript control); onclick executes the server-side event response.

Priority of both: OnClientClick > OnClick.

Examples of both exist in ASP controls:

Copy code code as follows:

  

Note that when we hit this button, the client is automatically executed first and then the server side is executed. If the client returns false, then the server-side corresponding method will never be executed. This will achieve detection, only through the implementation of server-side methods.

Which means if we write:

Copy code code as follows:

  

So no matter how the knot Jsdel executes. The server-side corresponding Btndel_click1 method will never be executed. Because return false makes the client always returns false

If we write:

Copy code code as follows:

  

Then the btndel_click1 will happen. And that's not going to work. That means you don't have to pass the test to do the server's way. So you have to pay attention.

3. The onclick of an ASP control differs from the onclick meaning of an HTML control: The former is responded by a server-side event and the other by the client.

4. HTML controls, when added runat= "Server", are essentially the same as ASP controls (which are now converted to server-side controls), and the server can respond to HTML controls.

5. The property keywords in HTML controls are lowercase. So we should pay attention to these details, small control will also have great research, and b/s development than C/s itself has complexity, a lot of details are not the same.

We know that the server control, in the ID will add a series of other parameters:

Similar:

Copy code code as follows:

  

  

Related Article

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.