Asp. What kinds of controls are there in the CPC? Where are the differences between HTML controls, HTML server controls, and Web server controls

Source: Internet
Author: User

Asp. NET controls include Web server controls, Web user controls, Web custom controls, HTML server controls, and HTML controls. The differences between HTML controls, HTML server controls, and Web server controls are as follows.
Q HTML control: This is entirely a browser-side HTML tag control, such as a radio box form control that is common in HTML, and its HTML code is shown in the following code.
<input type= "Radio" id= "Radio1" value= "Select1" checked= "checked"/>
This type of control is treated on the server side as a string sent directly to the browser side, which is parsed by the browser.
Q HTML server control: Add the "runat" property to the HTML control and set its value to "server".
Q Web Server control: Also known as an ASP. NET server control, is a Web programming element unique to ASP. The control runs on the server side, generating one or more HTML controls based on the execution of the code, rather than directly describing the HTML control. The Web server control begins with "asp:" followed by the control type name, as shown in the following code.
<asp:textbox runat= "Server" id= "MyTextBox" text= "initial text" textmode= "MultiLine" ></asp:TextBox>
This is a more frequent TextBox control, and you can see that controls in this way are very similar to Windows program controls.
Analysis
This paper examines the familiarity of the interviewer with the concept of control in ASP. HTML controls, HTML server controls, and Web server controls are the most commonly used control types in ASP. HTML controls run only on the browser side.
The difference between HTML server controls and HTML controls is how they run, ASP. NET runtime checks the "runat" property of the control to "server", the Page class object in which it resides puts the control into the controller, which can be controlled by the server-side code. When the server-side related control code finishes executing, the result of the HTML server control is converted to an HTML tag and then sent as a string to the browser side for parsing.
Web server controls provide a more unified programming interface, and programmers do not have to consider browser-side types, compatibility, and so on. Event handling for Web server controls is on the server side and can be saved to ViewState (view state).

Asp. What kinds of controls are there in the CPC? Where are the differences between HTML controls, HTML server controls, and Web server 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.