Differences between Html controls and Web controls

Source: Internet
Author: User

      DocumentWhen you do not need to interact with the background, you can use the HTML control. It consumes less resources and is fast. When you need to interact with the background, you can use the WEB control, or in HTMLAdd runat = "server" to the control"You can also convert an HTML control to an interactive control, but the resources occupied by the control are no different from those occupied by the Web control.

      The WEB control can respond to server events and SET related properties and methods in the background code! HTML is not allowed. WEB server controls need to be processed by the server and then translated into HTML controls and sent to the browser. Therefore, server resources are consumed and IEWSTATE exists, therefore, when sending a message back, the control status is maintained (or you can set it to not save it), which increases the amount of information sent back. HTML is directly sent to the browser, which does not consume server resources, but is saved stateless!   

      Obtain the value of the HTML control.FORM that requires REQUESTMethod, WEB controls can be processed directly through properties!

      Therefore, in general, HTML can be used where the control status does not need to be saved and there is no value to be processed. If you need to dynamically process the control or save its statusWEB Server Control! WEB server controls are easy to use, but they consume more server resources! 

      Many books have said that when considering performance, you should try not to use WEB server controls.   

     When to use it, you don't have to look at the specific situation. When the conditions are loose, you can look at your habits! (From: Fire Station Building College)

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.