HTML control Vs Web form control

Discussion in 'ASP .Net' started by Bhuwan Bhaskar, Nov 5, 2007.

  1. 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
     
    Bhuwan Bhaskar, Nov 5, 2007
    #1
    1. Advertising

  2. Mark Rae [MVP], Nov 5, 2007
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:uxe%...
    > 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
    >
     
    Eliyahu Goldin, Nov 5, 2007
    #3
  4. 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" <> wrote in
    message news:...
    > 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" <> wrote in message
    > news:uxe%...
    >> 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
    >>

    >
    >
     
    Kevin Spencer, Nov 5, 2007
    #4
    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. Matthew Louden
    Replies:
    1
    Views:
    7,104
    Scott M.
    Oct 11, 2003
  2. tom
    Replies:
    4
    Views:
    9,924
    S. Justin Gengo
    Nov 13, 2003
  3. Replies:
    5
    Views:
    801
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jun 12, 2007
  4. Ellie
    Replies:
    2
    Views:
    488
    Ellie
    Oct 30, 2008
  5. Rob R. Ainscough
    Replies:
    3
    Views:
    374
    Rob R. Ainscough
    Jun 14, 2005
Loading...

Share This Page