Can anyone give me the difference in using a webcontrol and a HTML contol with runat=server tag.
Thanks in advance.
Printable View
Can anyone give me the difference in using a webcontrol and a HTML contol with runat=server tag.
Thanks in advance.
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
declares a standard HTML text input field. However, the statementCode:<input type="text" />
<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
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:Code:<form runat="server">
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.Code:<form name="_ctrl0" method="post" action="calc.aspx" id="_ctrl0">
Hello nil,
You have not answered my question yet.
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
ThumbsUp
dotnetguy.