difference between web server control and html server control

Discussion in 'ASP' started by Carlos, Jun 14, 2009.

  1. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    Hi! I want to know when we should use asp.net server control and html server controls??

    However both of them are server side control.

    thanx
     
  2. extomas

    extomas New Member

    Joined:
    Apr 6, 2009
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    0
    html server??? What is this ?
     
  3. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    HTML Server controls are simple html controls having runat=server tag in it.
     
  4. gkumar

    gkumar New Member

    Joined:
    Jun 16, 2009
    Messages:
    58
    Likes Received:
    5
    Trophy Points:
    0
    HTML Server Controls
    HTML elements in ASP.NET files are, by default, treated as text. To make these elements programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control.

    Note: All HTML server controls must be within a <form> tag with the runat="server" attribute!

    Note: ASP.NET requires that all HTML elements must be properly closed and properly nested.


    Web Server Controls
    Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

    The syntax for creating a Web server control is:
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice