Learning asp.net, the video is always an example, which is a good thing, but one will use HTML server control, a Web server control, the first to do an example is also quite confused, do not know how to choose this control, the heart of the buckle is also very uncomfortable, decided to study it first and then continue to study, then just did a note but did not make a good summary, today, this part of the knowledge of the reorganization and take out to share with you.
1. What is an HTML server control?
is an evolution of HTML elements by converting HTML elements into HTML server controls, which means adding runat= "server" attributes, so that HTML element components can appear as components on the server, and can be programmed by components to create Web pages.
2. What is a Web server control?
Web server controls are also created on the server and need to be runat= "Server" properties to work. However, Web server controls do not have to map any existing HTML elements, and they can represent more complex elements.
3. Do they have any intrinsic difference ?
The single definition still doesn't see how big a difference it is. I can only understand that one needs to map HTML elements, one that does not require HTML elements. Speaking of which, I want to be sure that comrades have doubts about HTML elements. Oh, the HTML element refers to from the beginning tag to the end of all the tag code, see: Baidu Encyclopedia
Now let's show the difference by MindManager.
4. When do you use them respectively?
If some controls do not require server-side event or state management capabilities, you can select HTML controls, which can improve the performance of your application, or you can choose a Web server control if you need to dynamically process the control or save its state. Web server controls use it personally as a convenience, but consider performance in places where you can use Web server controls without
Now clear the difference between the two controls and contact, the next is to practice experience, practice is the hard truth, but without these to do bedding is not.