Requires Free Membership to View
When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to provide a unique online resource for developers, architects and development managers tasked with building and maintaining enterprise applications using Visual Basic, C# and the Microsoft .NET platform.
Hannah Smalltree, Editorial DirectorIn order to set values and modify these controls from .NET code (server-side), you need to right-click on them and select Run As Server Control, which introduces us to the server control concept. A server control is one that is run by ASP.NET, and available to .NET code in the code-behind or runat="server" script sections. Non-server controls (HTML) are not processed by ASP.NET. Rather, they are just design-time "views" of the underlying HTML source of the page itself.
Server controls can be either HTML Server Controls or Web Forms Controls (a.k.a. WebControls). The difference between the two is about functionality and design-time support. The latter have better designers, a more intuitive programming model, more OOP, can control their own rendering logic to better target the client platform, etc. So, if you need to access a control from .NET code, I'd say you should use WebControls. On the other hand, if you don't need to change a label text, a table configuration, etc., go for the the (non-server) HTML controls, which render faster and don't consume resources on the server for processing.
This was first published in November 2003