Re: HTML control Vs Web form control

Tech-Archive recommends: Speed Up your PC by fixing your registry



As Eliyahu said, HtmlControls are more lightweight, but it is important to
understand what the differences are in order to know what you need to use.
All HtmlControls are derived from System.Web.UI.HtmlControls.HtmlControl,
and all WebControls are derived from System.Web.UI.WebControls.WebControl.
Give the following MSDN references to these 2 base classes a read, and you
should be well-informed:

http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlcontrol.aspx
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@xxxxxxxxxxxx> wrote in
message news:egbeYo4HIHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
Html controls are lighter. One of typical scenarios where you may want to
use html controls is when you have an html prototype of your page and you
need to program it in asp.net. Then it is easier just to add runat=server
to html controls.

Web controls offer common set of server-side members that can make your
code cleaner and more readable.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Bhuwan Bhaskar" <kxxx@xxxxxxxxx> wrote in message
news:uxe%23IJ4HIHA.4560@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

I am new to asp.net. I want to know that, HTML and Web form control can
work in same way example, using "runat = Server" attribute, html control
can also executed at server, then what is the use of HTML control and is
there is any specific condition when we use only HTML control or web form
control.

Thanks and regards,
Bhuwan





.



Relevant Pages

  • "Hidden" Web Server Control
    ... I have a web form that a user uses to cycle through records in the DB to ... I need the WebForm to contain the identity key from the SQL Server table so ... I would REALLY rather not put a Hidden HTML control on the form and have to ... "When you kill a man, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: "Hidden" Web Server Control
    ... I have a web form that a user uses to cycle through records in the DB ... I need the WebForm to contain the identity key from the SQL Server ... I would REALLY rather not put a Hidden HTML control on the form and ... Kill many, and you're a conqueror. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to Access HTML Controls from code behind ?
    ... you have to use the tag runat and id in HtmlControls. ... How can an HTML control be accessed in code behind? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: input control id and for loop
    ... a HTML control is working on the client side ... a ASPNET control is working on the server side. ... the textbox id property for what you want by using a textbox servercontrol. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: question about HTML control with runat="server"
    ... except for a small list of html control, most end up as a generic html control. ... I want to do a 'server onclick', just like the control, but it doesn't appear in the Intellisense nor in code-behind. ... What's the difference with a HTML input control not running on the server, since it's not possible to 'onclick' on the server? ...
    (microsoft.public.dotnet.framework.aspnet)