ASP.NET 2.0 Server Controls
What are ASP .Net 2 server controls?
We have seen that HTML 2.0 allows us to use `controls' on our page for user interaction. These controls are actually elements like buttons, text boxes and drop down lists, much like the controls that we see in any desktop application.
ASP.NET 2.0 provides a set of controls known as server controls. These controls provide much more functionalities than the HTML controls and make the process of web application development a lot easier.
There is a basic difference between the HTML controls and the Server controls. The browser understands HTML controls and knows how to display them correctly. However, the browser does not understand the server controls. When a user requests a web page that contains server controls, the web server (where the page is stored) converts the server control into its equivalent HTML code and then sends the page to the browser. This simply means that it is the web server and not the browser that processes the server controls.
When developing an ASP.NET 2.0 web page, using server controls are preferable. If the controls are simple and do not require much functionalities, we can use the HTML controls. However, there are many server controls, which have no equivalent HTML controls.
HTML controls can be converted into server controls. ASP.NET 2.0 provides a method for this conversion and it is simple. All we need to do is to right-click on the control and select `Run as Server Control' option from the menu. This will convert the HTML control into a server control and provide extra functionalities. It is a great feature if we want to convert a previously created HTML page into an ASP.NET 2.0 page. For creating a new page however, using server controls is recommended.