System.Web.UI.HtmlControls.HtmlAnchor Class

Allows programmatic access to the HTML <a> element on the server.

See Also: HtmlAnchor Members

Syntax

[System.Web.UI.SupportsEventValidation]
[System.ComponentModel.DefaultEvent("ServerClick")]
public class HtmlAnchor : HtmlContainerControl, System.Web.UI.IPostBackEventHandler

Remarks

There are two ways to use the System.Web.UI.HtmlControls.HtmlAnchor class. The first is for navigation: using the HtmlAnchor.HRef property to define the location of the page to link to. The second is for postback events: using the HtmlAnchor.ServerClick event to programmatically handle the user's clicking a link.

Note:

This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input. For more information, see Validation Server Controls.

For a list of initial property values for an instance of System.Web.UI.HtmlControls.HtmlAnchor, see the HtmlAnchor.#ctor constructor.

Requirements

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0