By default, HTML elements within an ASP.NET file are treated as literal text and you cannot reference them in server-side code. To make these elements programmatically accessible, you can indicate that an HTML element should be treated as a server control by adding the runat="server" attribute. You can also set the element's id attribute to give you way to programmatically reference the control. You then set attributes to declare property arguments and event bindings on server control instances.
To add an HTML server control
Type the HTML syntax of the element you want to use as a control. Include the normal HTML syntax for the element, and in addition, do the following:
- Set the control's ID attribute (property) to a unique value for that page, unless the control is part of a complex control and will be repeated (as in Repeater, DataList, and GridView controls).
- Set the runat="server" attribute to convert the element to a control.
<input id="Name" type="text" size="40" runat="server" />
<input type="submit" id="Enter" value="Enter" runat="server" />
Click <a id="Anchor1" runat="server" href="more.html">More </a> to see the next page
The code snippet above shows an HtmlInputText, an HtmlInputButton and HtmlAnchor server controls.
Note: All Html Server controls require that they be enclosed in a <form> server tag.
Very interesting and good Explanation
ReplyDeleteASP NET Training
ASP NET Training
ASP NET Online Training
C-Sharp Training
Dot Net Training in Chennai
Online .Net Training
Great Article
DeleteIEEE Final Year Projects for CSE
IEEE Project Centers in Chennai
comunidades
ReplyDeletebravesites
ucoz
yolasite
eklablog
productzone
over-blog
Nice Blog.Thank you for Sharing. We are leading erp software software solution providers in chennai.
ReplyDeleteerp in chennai | cloud erp software in chennai
Your website content nice nice and interesting to observe.
ReplyDeleteoffice 2013 professional plus key deutsch
thanks for the useful post
ReplyDeleteWebdesign Lüdenscheid
Great Blog to read, It gives more useful information. Thank lot.
ReplyDeleteOnline Training for Big Data
Big Data Hadoop Online Training
Đại lý vé máy bay Aivivu
ReplyDeleteVé máy bay đi Mỹ
vé máy bay từ seattle về việt nam
ve may bay tu canada ve viet nam
Lịch bay từ Seoul đến Hà Nội
giá vé máy bay từ anh về việt nam
các chuyến bay từ châu âu về việt nam
vé máy bay từ đức về việt nam
thông tin chuyến bay từ nga về việt nam
vé máy bay giá rẻ đi Los Angeles
cách ly khách sạn trọn gói