Difference in Web server Controls and HTML Server Controls

Discussion in 'ASP .Net' started by =?Utf-8?B?c2lhag==?=, Mar 7, 2005.

  1. Hello All,
    Can any one give me a clue when to use Web Server controls/ HTML server
    controls/HTML Controls. As I understand ..
    HTML controls should be used if u dont need to refer it in the code behind
    a(simply bcaz it is not recognized in the code behind IDE) and it does not
    make a server trip.
    HTML server Controls should be preferred over Web Server controls as they
    are light weight than ASP.NET web Server controls.(If they have same
    performance why ever use HTML server controls??)
    Web Server controls should be used only when that control is not there in
    HTML server control...like calender control,datagrid)

    any suggestion wil be appreciated..



    Cheers,
    siaj
     
    =?Utf-8?B?c2lhag==?=, Mar 7, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?c2lhag==?=

    Karl Seguin Guest

    Siaj:
    I'd say you are right about plain-jane HTML controls...they are useful when
    you don't need them on the server.

    The real question is when to user html server controls and web server
    controls.

    First, the most obvious answer is when you don't have a choice. For example
    there's nothing like the repeater/datagrid/datalist/calendar/... in html
    server controls so you don't really have a choice. Also, there's nothing
    like an input type="file" for web server controls so you have to use the
    html server control.

    However, html server controls partly exist just to help developers migrate
    to ASP.Net because all you need to do is add an id and a runat="server" and
    you are up and running. If you are starting a project from scratch, I'd
    always prefer web server controls because they provide greater flexibility.
    I wouldn't let any performance differences (if there are any) be a factor
    because I'd expect it to be extremely small if anything..

    (gonna add this one to the FAQ I think)

    Hope that helped,
    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "siaj" <> wrote in message
    news:...
    > Hello All,
    > Can any one give me a clue when to use Web Server controls/ HTML server
    > controls/HTML Controls. As I understand ..
    > HTML controls should be used if u dont need to refer it in the code behind
    > a(simply bcaz it is not recognized in the code behind IDE) and it does

    not
    > make a server trip.
    > HTML server Controls should be preferred over Web Server controls as they
    > are light weight than ASP.NET web Server controls.(If they have same
    > performance why ever use HTML server controls??)
    > Web Server controls should be used only when that control is not there in
    > HTML server control...like calender control,datagrid)
    >
    > any suggestion wil be appreciated..
    >
    >
    >
    > Cheers,
    > siaj
     
    Karl Seguin, Mar 7, 2005
    #2
    1. Advertising

  3. > HTML controls should be used if u dont need to refer it in the code behind
    > a(simply bcaz it is not recognized in the code behind IDE) and it does

    not
    > make a server trip.

    Not true. You can always add runat=server to any html and it will be
    recognized on server.

    > HTML server Controls should be preferred over Web Server controls as they
    > are light weight than ASP.NET web Server controls.(If they have same
    > performance why ever use HTML server controls??)

    Should be true. Not aware of any figures though.

    > Web Server controls should be used only when that control is not there in
    > HTML server control...like calender control,datagrid)

    Not only. Web controls inherit from another class. They have different set
    of members. You might prefer them just because you like their members. They
    also more consistent between themselves.

    Eliyahu
     
    Eliyahu Goldin, Mar 7, 2005
    #3
  4. =?Utf-8?B?c2lhag==?=

    MasterGaurav Guest

    MasterGaurav, Mar 7, 2005
    #4
  5. Has anyone done any testing with this? I am not sold on the fact that HTML
    Controls that are marked with runat="server" is more efficient that using
    the web server controls. All controls marked with this attribute is
    compiled along with your page class and I don't see where performance would
    come into play. I'm sure someone with more time on their hands than I , have
    done some benchmark testing. :)


    "Eliyahu Goldin" <> wrote in message
    news:%...
    >> HTML controls should be used if u dont need to refer it in the code
    >> behind
    >> a(simply bcaz it is not recognized in the code behind IDE) and it does

    > not
    >> make a server trip.

    > Not true. You can always add runat=server to any html and it will be
    > recognized on server.
    >
    >> HTML server Controls should be preferred over Web Server controls as they
    >> are light weight than ASP.NET web Server controls.(If they have same
    >> performance why ever use HTML server controls??)

    > Should be true. Not aware of any figures though.
    >
    >> Web Server controls should be used only when that control is not there in
    >> HTML server control...like calender control,datagrid)

    > Not only. Web controls inherit from another class. They have different set
    > of members. You might prefer them just because you like their members.
    > They
    > also more consistent between themselves.
    >
    > Eliyahu
    >
    >
     
    Tampa.NET Koder, Mar 7, 2005
    #5
  6. =?Utf-8?B?c2lhag==?=

    Scott Allen Guest

    Some information here:

    WebControls and HtmlControls

    http://odetocode.com/Articles/348.aspx

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Mon, 7 Mar 2005 07:25:02 -0800, "siaj"
    <> wrote:

    >Hello All,
    >Can any one give me a clue when to use Web Server controls/ HTML server
    >controls/HTML Controls. As I understand ..
    >HTML controls should be used if u dont need to refer it in the code behind
    >a(simply bcaz it is not recognized in the code behind IDE) and it does not
    >make a server trip.
    >HTML server Controls should be preferred over Web Server controls as they
    >are light weight than ASP.NET web Server controls.(If they have same
    >performance why ever use HTML server controls??)
    >Web Server controls should be used only when that control is not there in
    >HTML server control...like calender control,datagrid)
    >
    >any suggestion wil be appreciated..
    >
    >
    >
    >Cheers,
    >siaj
     
    Scott Allen, Mar 7, 2005
    #6
  7. HTML controls are lighter weight, while web controls are more powerful.
    Like everything in programming, it's a trade off.

    Here are more details:
    http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "siaj" <> wrote in message
    news:...
    > Hello All,
    > Can any one give me a clue when to use Web Server controls/ HTML server
    > controls/HTML Controls. As I understand ..
    > HTML controls should be used if u dont need to refer it in the code behind
    > a(simply bcaz it is not recognized in the code behind IDE) and it does
    > not
    > make a server trip.
    > HTML server Controls should be preferred over Web Server controls as they
    > are light weight than ASP.NET web Server controls.(If they have same
    > performance why ever use HTML server controls??)
    > Web Server controls should be used only when that control is not there in
    > HTML server control...like calender control,datagrid)
    >
    > any suggestion wil be appreciated..
    >
    >
    >
    > Cheers,
    > siaj
     
    Steve C. Orr [MVP, MCSD], Mar 7, 2005
    #7
  8. Thanks a lot...



    "Steve C. Orr [MVP, MCSD]" wrote:

    > HTML controls are lighter weight, while web controls are more powerful.
    > Like everything in programming, it's a trade off.
    >
    > Here are more details:
    > http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://SteveOrr.net
    >
    >
    > "siaj" <> wrote in message
    > news:...
    > > Hello All,
    > > Can any one give me a clue when to use Web Server controls/ HTML server
    > > controls/HTML Controls. As I understand ..
    > > HTML controls should be used if u dont need to refer it in the code behind
    > > a(simply bcaz it is not recognized in the code behind IDE) and it does
    > > not
    > > make a server trip.
    > > HTML server Controls should be preferred over Web Server controls as they
    > > are light weight than ASP.NET web Server controls.(If they have same
    > > performance why ever use HTML server controls??)
    > > Web Server controls should be used only when that control is not there in
    > > HTML server control...like calender control,datagrid)
    > >
    > > any suggestion wil be appreciated..
    > >
    > >
    > >
    > > Cheers,
    > > siaj

    >
    >
    >
     
    =?Utf-8?B?c2lhag==?=, Mar 7, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Silver
    Replies:
    8
    Views:
    2,859
    Alan Silver
    Jan 24, 2005
  2. jakk
    Replies:
    4
    Views:
    12,595
  3. SAI
    Replies:
    4
    Views:
    4,558
    Eliyahu Goldin
    Jun 26, 2005
  4. BIG BOY
    Replies:
    13
    Views:
    36,989
    manoj212077
    Sep 19, 2009
  5. brian

    HTML Server Controls vs Web Server Controls

    brian, Jan 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    324
    Steve C. Orr [MVP, MCSD]
    Jan 24, 2005
Loading...

Share This Page