What's the difference between HTML controls and the basic web controls?

  • Thread starter Thread starter Alan Silver
  • Start date Start date
A

Alan Silver

Hello,

ASP.NET newbie here so please be nice ;-)

I'm reading ASP.NET Unleashed, following a recommendation here. I am a
little confused about the difference between HTML controls and web
controls. Obviously there are web controls that don't have any relation
to HTML controls (like the calendar), but the basic web controls that
produce links, labels, etc seem to do the same as the HTML controls (or
vice-versa).

So, what's the difference and why use one over the other?

TIA
 
One of the differences is to upgrade from another language...it's much
easier to upgrade HTML to use HTMLControls as all you typically need is to
add an id and a runat="server". WebControls require more changes. Having
said that, webcontrols provide more capacity so down the road it's good to
go towards them.

There are also html controls which have no relations to web controls, such
as the fileinput and the generic controls...

Karl
 
Alan,

They inherit from different classes and have different sets of members.

Eliyahu
 
Karl,

Thanks for the reply. Since I'm only looking at ASP.NET for new projects
(I'm happy to leave the old ones in Classic ASP until it's worth
rewriting them from scratch), I guess that means that I would be looking
more at web controls then?

Thanks again
 
I only use HtmlControls when there's a specific need (which there certainly
are)...from what I've seen that's typically the approach taken.

Karl
 
I only use HtmlControls when there's a specific need (which there certainly
are)...from what I've seen that's typically the approach taken.

Thanks Karl, that's a useful rule. Helps clarify matters when you can
distil it down to something that simple!!
 

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

Back
Top