Understanding ASP.NET Server Controls

The ASP.Net server controls have many advantages over using the ordinary html controls. The server controls follow an object oriented programming model and hence they are easily programmable dynamically.

This enables you to separate the code that is to be executed from the code that is used to display. They have rich set of properties, events and methods.

The server controls have an attribute runat="server". This indicates that that particular control is a server control and is executed at the server. There three types of server controls basically in ASP.Net. They are HTML Server Control, Web Server Control, and Validation Server Control.

The HTML server control are the ordinary html controls that you use in your web page and they have an attribute called runat="server" added to it. The Web Server Controls are the tags that are found in ASP.Net especially and they have syntax like,

<tag_prefix:control_name attributes runat="server" />

The Validation Server controls also have the above syntax. They are used for validating a user input against some value or a range of values. Upon invalid input you can throw some error message to the user. These controls are more useful in processing forms in the web page.