newbie: HTML controls vs Web controls

  • Thread starter Thread starter R.A.M.
  • Start date Start date
R

R.A.M.

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/
 
It depends on what you are more comfortable with. If you come from Windows
application background, you will find that web controls are more friendly
and they are a less dramatic change from your previous experience.. If you
come from html background you will like html controls. As you master your
asp.net skills, you will likely lean more towards html controls as they give
you better control over client-side functionality.
 
Hi,

R.A.M. said:
Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/

The System.Web.UI.HtmlControls namespace is for HTML controls, in the
sense that they are declared on the page using standard HTML tags, for
example "input", "select", "textarea", etc...

The System.Web.UI.WebControls namespace is for ASP.NET controls, which
are declared on the page with an "asp:" prefix, for example "asp:Checkbox".

The different is that in the first case, they're client-side controls.
You use them on the server in order to set attributes, scripts, etc...
which are executed on the client. In the second case, however, (and
while you can also influence the way they will be rendered on the
client), the events you wire them to are executed on the server
(involving a postback).

HTH,
Laurent
 
Back
Top