Reputation: 22441
As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?
Upvotes: 2
Views: 360
Reputation: 28867
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.
Upvotes: 5
Reputation: 118
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).
Upvotes: 2