System.Web.UI.HtmlControls Namespace
Allows programmatic access to the HTML <a> element on the server.
Visibility |
Constructor |
Parameters |
public |
HtmlAnchor |
( )
|
|
There are two ways to use the HtmlAnchor class. The first is for navigation, and the second is for responding to postback events.
For navigation, the <a> element requires either the:
- HRef property when used as a hypertext link, to define the destination URI of the page to link to.
- Name property when used as an anchor, to identify a named location within a document.
Both text and images can be included within the <a> element used as a hyperlink.
When used for postback events, a method must be defined for the ServerClick event to programmatically handle the user's click on a link.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see HtmlAnchor in ASP.NET Syntax for HTML Controls.
Hyperlink HtmlContainerControl