System.Web.UI.WebControls Namespace HyperLink Class
Sets or retrieves the destination of the HyperLink control.
Inline |
<asp:hyperlink navigateurl = strUrl ... > |
Script |
HyperLink.NavigateUrl [ = strUrl ] |
strUrl |
String specifying the URL to link to when the hyperlink is clicked. |
The property is read/write with no default value.
Use the NavigateUrl property to specify or determine the URL to navigate to when the HyperLink control is clicked.
The NavigateUrl property on a hyperlink can refer to:
- any valid URI
- any valid anchor point or bookmark within a document.
In certain cases, as when hyperlinks are used within templated controls, the NavigateUrl property is usually obtained dynamically from a data source.
The following example shows how to declaratively set the ImageUrl property of a HyperLink control at design time.
<asp:hyperlink runat = "server"
text = "Simply awesome"
imageurl = "~/shared/aspxtreme.jpg"
navigateurl = "~/index.aspx" />
The following examples demonstrate how to dynamically bind the NavigateUrl property of HyperLink controls defined within templates.
HyperLink Members ImageUrl Text