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

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
 
K

Karl Seguin

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
 
E

Eliyahu Goldin

Alan,

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

Eliyahu
 
A

Alan Silver

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
 
K

Karl Seguin

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
 
A

Alan Silver

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top