Programming HTML Controls

In this section we'll take a look, one by one, at the HTML controls provided by ASP.NET and show you examples of some of the more interesting ones.

HtmlAnchor

Member of System.Web.UI.HtmlControls.

Assembly: System.Web.Dll.

The HtmlAnchor control encapsulates the <a> tag with a server-side control model. You shouldn't use this for every link, but it makes it easy to dynamically generate links as needed.

Properties
Attributes ClientID Controls
Disabled EnableViewState Href
ID InnerHtml InnerText
Name NamingContainer Page
Parent Site Style
TagName Target TemplateSourceDirectory
Title UniqueID Visible
Methods
DataBind Dispose Equals
FindControl GetHashCode GetType
HasControls RenderControl ResolveUrl
ToString   
Events

Get C#® Developer's Guide to ASP.NET, XML, and ADO.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.