|
HTML tags are the HTML server controls that are understood by the server.
In ASP.NET files,HTML elements are, by default, treated as text.
Aadd a runat="server" attribute to the HTML element to make these elements programmable. This attribute indicates that the element should be treated as a server control and the id attribute
is added to identify the server control.To manipulate the server control at run time, the id reference can be used.
Note: All HTML server controls must be present within a <form>
tag with the runat="server" attribute. The runat="server"
attribute indicates that the form should be processed on the
server and it also indicates that the enclosed controls can be
accessed by server scripts.
In the following example we declare an HtmlAnchor server
control in an .aspx file and then we manipulate the HRef attribute
of the HtmlAnchor control in an event handler (an event handler
is a subroutine that executes code for a given event). The
Page_Load event is one of the many events that ASP.NET understands:
|