HTML Server Controls in ASP.NET With Examples

HTML Server Controls in ASP.NET

In ASP.NET, we may convert an HTML element to an HTML server control by adding an attribute runat=”server”. This notifies the ASP Engine to create an instance of the control during parsing. We need to specify an ID of the element so that we can manipulate it pro-grammatically on the server side. These controls are particularly useful for migrating ASP applications to ASP.NET applications.

HtmlAnchor Control

The HtmlAchor control is used to navigate from one page to another page. It basically works almost like the Html anchor tag, the only difference is that it works on the server.

HtmlTable Control

This control is a container control, so we can embed other controls in its cells. We may define rows <tr>tags. Table cells are defined using <td>.