difference between HtmlControls and WebControls?

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" /> ?
 
S

Steve C. Orr [MVP, MCSD]

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.
 
H

Henri

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
 
S

Steve C. Orr [MVP, MCSD]

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
 
H

Henri

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top