System.Web.UI.WebControls Namespace HyperLink Class
Sets or retrieves the text displayed for a HyperLink control.
Inline |
<asp:hyperlink text = strtext ... > |
Script |
HyperLink.Text [ = strtext ] |
strtext |
String that specifies the text caption for the hyperlink. |
The property is read/write with no default value.
Use the Text property to specify or determine the caption displayed for the HyperLink control.
If an ImageUrl is defined, it will take precedence over this property. This property will then be used as the alternate text for the image.
In certain cases, as when hyperlinks are used within templated controls, the Text property is usually obtained dynamically from a data source.
The following example shows how to declaratively set the Text property of a HyperLink control at design time.
<asp:hyperlink runat = "server"
text = "Simply awesome"
navigateurl = "~/index.aspx" />
HyperLink Members ImageUrl NavigateUrl