Over the past 10 days, I have been watching ASP. net Video, a junior high school graduate student, self-taught, right. net is much better than any one of us. It can also be used as our teacher to check related information on the Internet. Tian hongchuan confidently said, "In. NET technology, I am willing to accept the challenge of any it Master student. I am a self-taught master student !". I still admire him.
The following is a summary of the gains on controls over the past few days!
Controls in ASP. NET can be divided into two categories: Web server controls and HTML client controls.
A common HTML Script control is a client control. The content displayed on the page displayed by the client can also be converted to a server control. You only need to add the runat = "server" attribute ". For example:
<input id="Button2" type="button" value="button"/> <input id="Button3" type="button" runat="server" value="button" />
The former is a client control, and the latter is a server control. The HTML control runs on the client, while the HTML server control runs on the server. When ASP. when the web page is executed, the system checks whether the annotation has the runat attribute. If the annotation is not set, the HTML annotation will be treated as a string and sent to the string stream for sending to the client, the browser of the client will explain it. If the HTML annotation has the set runat = "server" attribute, the page object will put the control into the controller, and the server code will be able to control it, after the control is executed, convert the execution result of the HTML Server Control to HTML annotation, and then send it as a string stream to the client for explanation.
A Web Server Control starts with ASP:. It is called a tag prefix and is followed by a control type. For example:
<asp:Button ID="Button2" runat="server" Text="Button"/>
This annotation method clearly knows the specific type of the control, unlike the input tag in the HTML control, but also depends on the type attribute. By observing the server control, we can find that, the runat = "server" attribute is an essential attribute; otherwise, an error occurs; the Web Control name is clear and clear; the web control can be C # programmed like Windows form, has methods and attributes, and responds to events to execute complex page requests. The HTML annotation and HTML Server Control event processing are both on the client page, while the Asp.net server control is on the server, although the Web Server Control and HTML server control code in HTML code are different, they are displayed the same in the browser (for browsers, they are treated equally, both send data to the server for execution and then return results. Two different types of controls generate the same HTML Tag code)
It can be seen that HTML tagging and HTML server control events are triggered by pages, while Asp.net server controls are sent back to the server by pages for processing.