Difference between Html Element and Web Controls

Discussion in 'ASP .Net' started by SAI, Jun 26, 2005.

  1. SAI

    SAI Guest

    Both have "TextBox" element and "Runat server". I don't understand the
    difference. Please advise. Thanks.
    SAI, Jun 26, 2005
    #1
    1. Advertising

  2. SAI wrote:

    > Both have "TextBox" element and "Runat server". I don't understand the
    > difference.


    ASP.NET tries to provide controls that are close to the HTML elements
    and the client-side browser object model (the HtmlControls) and controls
    which are close to the API Windows developers are used to from WinForms
    GUI development.
    There is some overlapping functionality that way and it is up to you to
    decide what you prefer.

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 26, 2005
    #2
    1. Advertising

  3. SAI

    Scott M. Guest

    Not quite.

    There are actually 3 "families" of controls to choose from:

    HTML Controls are standard HTML controls that have been a part of the HTML
    language for years. These are not classes, they are tags and you can only
    do client-side programming with them.

    HTML Server Controls are the exact same as above but have: runat="server"
    added to them. These controls add server side programmatic capabilities to
    the otherwise standard HTML Control. Use these controls when migrating old
    web applications to .NET applications.

    Web Form Controls (a.k.a. Server Controls) are .NET Classes that expose a
    rich set of properties, methods and events. They are programmable on the
    client and/or the server. There are some that offer the same UI as HTML
    Controls but have more features and there are some that offer a much richer
    UI that would take quite a bit of programming if they were to be made in
    standard HTML from scratch (i.e. Calendar Control, DataGrid Control,
    Validation Controls). All of these controls render to the client as HTML
    and/or CSS and/or JScript. Use these when rich UI's and/or rich
    programmatic capabilities are needed.




    "Martin Honnen" <> wrote in message
    news:...
    >
    >
    > SAI wrote:
    >
    >> Both have "TextBox" element and "Runat server". I don't understand the
    >> difference.

    >
    > ASP.NET tries to provide controls that are close to the HTML elements and
    > the client-side browser object model (the HtmlControls) and controls which
    > are close to the API Windows developers are used to from WinForms GUI
    > development.
    > There is some overlapping functionality that way and it is up to you to
    > decide what you prefer.
    >
    > --
    >
    > Martin Honnen --- MVP XML
    > http://JavaScript.FAQTs.com/
    Scott M., Jun 26, 2005
    #3
  4. Take a look at the list of their classes :

    HTML Controls :
    http://www.csharpfriends.com/quicks...ser.aspx?namespace=System.Web.UI.HtmlControls

    WEB Controls :
    http://www.csharpfriends.com/quicks...wser.aspx?namespace=System.Web.UI.WebControls

    You'll notice a LOT of differences.

    Drilling down ( by clicking ) in the HTML controls to the HtmlInputControl:
    http://www.csharpfriends.com/quicks...em.Web.UI.HtmlControls&class=HtmlInputControl

    will show you the differences between that control and the Textbox web control:
    http://www.csharpfriends.com/quicks...space=System.Web.UI.WebControls&class=TextBox

    There's some crossover between web controls and html controls,
    but the differences between them are many.

    Keep those links handy whenever you need to know the
    difference between any other controls supplied both by

    System.Web.UI.HtmlControls
    and
    System.Web.UI.WebControls



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    Ven, y hablemos de ASP.NET...
    ======================

    "SAI" <> wrote in message news:...
    > Both have "TextBox" element and "Runat server". I don't understand the difference.
    > Please advise. Thanks.
    >
    Juan T. Llibre, Jun 26, 2005
    #4
  5. Html and web controls inherit from different parents and have different sets
    of properties, methods and events. If you need any sort of functionality
    specific for web controls, use them. Otherwise use html ones, they are
    lighter.

    Eliyahu

    "SAI" <> wrote in message
    news:...
    > Both have "TextBox" element and "Runat server". I don't understand the
    > difference. Please advise. Thanks.
    >
    >
    Eliyahu Goldin, Jun 26, 2005
    #5
    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,815
    Alan Silver
    Jan 24, 2005
  2. =?Utf-8?B?c2lhag==?=
    Replies:
    7
    Views:
    1,455
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  3. jakk
    Replies:
    4
    Views:
    12,029
  4. tankbattle
    Replies:
    1
    Views:
    780
    George Bina
    Jul 21, 2006
  5. Masudur
    Replies:
    12
    Views:
    1,015
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 26, 2007
Loading...

Share This Page