difference between HtmlControls and WebControls?

  • Thread starter Thread starter Henri
  • Start date Start date
H

Henri

For instance, when should I use HtmlControls.HtmlImage,
and when should I use WebControls.Image ?

And what is the difference between
<img runat="server" />
and
<asp:image runat="server" /> ?
 
The first example you gave <img runat="server"> is an HTML control.
The second example you gave <asp:image runat="server" /> is a web control.

HTML controls are quick and small and require little memory. Conversly, web
controls provide more advanced functionality than HTML controls.

If you're an old school HTML web developer then you'll find the HTML
controls to be intuitive and familiar. If you have more of a
Windows/VB/ActiveX background then you're more likely to feel at home with
the extra features that web controls provide.
 
Very clear, thanks a lot!
:-)
To make a custom control, it seems that many control developpers inherit
WebControls. What does it add more than inheriting HtmlControl or Control?

Henri
 
HTML controls weren't designed to be extensible.
Therefore, when making your own controls you should inherit from WebControl
or Control.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
 
Thanks :-)

Steve C. Orr said:
HTML controls weren't designed to be extensible.
Therefore, when making your own controls you should inherit from WebControl
or Control.
 
Back
Top