The difference between an "ASP.--web" Control and an HTML control

Source: Internet
Author: User

In the process of looking at the ASP, we encountered some explanations of the control, and by querying the data, we simply said the difference between the two.


Control location


In VS, the HTML control is located in:



Web Control Location:



Control style


HTML controls:

In addition to a few special controls: Textarea, Table, Image, Select, horizontal Rule, Div, the rest of the controls have input, and

The most obvious difference from Web controls is that the HTML control does not have the word "runat=" Server "".

Web control:

Own keywords: asp and "Runat=server"


HTML control transforms to Web control


The description of the Web control and the HTML control described above has actually been able to elicit this proposition. How to treat HTML controls as

What is the Web control used for? It's simple! Add a "runat=" server "to the HTML control" and it's OK!

The most obvious difference between Web controls is, in client code, with "this." Behind can come out the corresponding control Oh!


the advantages and disadvantages of each


Html:

Advantages:

1. HTML controls can be programmed both on the server and on the client. (Because client controls can be used as server-side controls)

2. Use an HTML server control to convert an existing HTML or ASP page to a Web Forms page.

Disadvantages:

1. All values are strings and there is no type security.

2, can support a variety of browsers, but must use extended style, self-programmed.

3. User-style browser function cannot be detected automatically.

Web Service side:

Advantages:

1. Typed object The model is simple to program and easy to check and error.

2, automatically generate the correct HTML for the browser.

3. Can be used to generate more complex server controls, such as Calendar and DataGrid.

Disadvantages:

Directly controls the server control, so the ability to render the browse page is weak.



Summary


There's a lot more to this piece of control, and it was really a shame to control it! The next time the validation controls are described in detail, expect

Means

The difference between an "ASP.--web" Control and an HTML control

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.