views:

167

answers:

2

As I put together each asp.net page Its clear that most of the time I could use the standard html tags just as easily as the webforms controls. When this is the case what is the lure of the webforms controls?

A: 

Webform controls have more server-side pre-built functionality (server side hooks, methods and attributes), I tend to use HTML controls only when I require a high degree of formatting (styling) as that bypasses the way .Net renders it's controls (which, at times, can be very strange).

Martin
Thanks for your answer Martin. I have seen my share of this 'strange' behavior myself.
minty
+2  A: 

HTML controls will be output a lot faster than server controls since there is nothing required on part of the server.. It just literally copies the markup in the ASPX page.

Server controls however require instantiation.. Parsing of the postback data and the like, this is obviously where the work comes in for the server.

The general rule of thumb is:

If its static (i.e. you dont need programmatic support), make it a HTML control. HTML controls can easily be "upgraded" to server controls so there is no real issue of maintanence at a later time.

Rob Cooper