Results 1 to 4 of 4

Thread: HTML controls Vs WebControls -

  1. #1
    Join Date
    Aug 2005

    HTML controls Vs WebControls -

    Can anyone give me the difference in using a webcontrol and a HTML contol with runat=server tag.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2005
    Most Web forms are built from Web controls, but ASP.NET supports a second type of server control called HTML controls. HTML controls are instances of classes defined in the FCL's System.Web.UI.HtmlControls namespace. They're declared by adding RunAt="server" (or, if you'd prefer, runat="server"; capitalization doesn't matter in HTML) attributes to ordinary HTML tags. For example, the statement

    <input type="text" />
    declares a standard HTML text input field. However, the statement

    <input type="text" runat="server" />
    declares an HTML control-specifically, an instance of System.Web.UI.HtmlControls.HtmlInputText. At run time, ASP.NET sees the runat="server" attribute and creates an HtmlInputText object. The HtmlInputText object, in turn, emits an <input type="text"> tag that's ultimately returned to the browser.

    Without realizing it, you used an HTML control in Calc.aspx. The line

    <form runat="server">
    caused an instance of System.Web.UI.HtmlControls.HtmlForm to be created on the server. HtmlForm returned the <form> tag that you saw when you viewed the page's HTML source code with the View/Source command:

    <form name="_ctrl0" method="post" action="calc.aspx" id="_ctrl0">
    HtmlInputText and HtmlForm are but two of many controls defined in the System.Web.UI.HtmlControls namespace. The following table lists all the HTML controls that the FCL supports and the tags that produce them.

  3. #3
    Join Date
    Aug 2005
    Hello nil,

    You have not answered my question yet.

  4. #4
    Join Date
    Sep 2005

    Re: HTML controls Vs WebControls -

    Ok friend, I will explain at length.

    HTML controls are a duplicates of ASP. Let me explain again....

    ASP.NET is a new technology. Its million years ahead than asp.
    HTML controls are duplicates of old HTML controls. In case you would like
    to convert your design to, you just have to add "runat" attribute to it
    and change the page to aspx.

    While WebControls are a revolution. You can place all the HTML controls as you
    were placing in dreamweaver. The page shows that WebControls are placed,
    but in fact the controls are generated only on server.

    all html controls are been replaced with web controls and many are added.

    for more details visit here, and have look at tutorials.


Similar Threads

  1. Parental controls for Mac OS X
    By quoip in forum Operating Systems
    Replies: 14
    Last Post: 11-11-2010, 11:01 PM
  2. what controls a mouse?
    By celafox in forum Off Topic Chat
    Replies: 2
    Last Post: 23-09-2010, 01:15 PM
  3. Controls in Silverlight 4
    By Dewei in forum Windows Software
    Replies: 4
    Last Post: 05-08-2010, 12:21 AM
  4. Replies: 3
    Last Post: 22-09-2009, 01:12 PM
  5. How do I get the HTML code to display as HTML code?
    By NAYASA in forum Software Development
    Replies: 3
    Last Post: 26-12-2008, 01:35 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Page generated in 1,685,802,074.49529 seconds with 17 queries