Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 18-08-2005
Join Date: Aug 2005
Posts: 2
HTML controls Vs WebControls - ASP.net

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

Thanks in advance.
Reply With Quote
Old 19-08-2005
Join Date: Jan 2005
Location: bombay
Posts: 171
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.
Reply With Quote
Old 19-08-2005
Join Date: Aug 2005
Posts: 2
Hello nil,

You have not answered my question yet.
Reply With Quote
Old 21-09-2005
Join Date: Sep 2005
Location: India
Posts: 3
Re: HTML controls Vs WebControls - ASP.net

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 asp.net, 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 www.asp.net, and have look at tutorials.http://forums.techarena.in/images/sm...thumbs_up2.gif

Reply With Quote

  TechArena Community > Software > Software Development
Tags: , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "HTML controls Vs WebControls - ASP.net"
Thread Thread Starter Forum Replies Last Post
Parental controls for Mac OS X quoip Operating Systems 14 11-11-2010 11:01 PM
what controls a mouse? celafox Off Topic Chat 2 23-09-2010 01:15 PM
Controls in Silverlight 4 Dewei Windows Software 4 05-08-2010 12:21 AM
How to define HTML Validator and services provided by HTML Validator Aldous Software Development 3 22-09-2009 01:12 PM
How do I get the HTML code to display as HTML code? NAYASA Software Development 3 26-12-2008 01:35 PM

All times are GMT +5.5. The time now is 12:21 PM.