Back to Devexpress

ASPxHyperLink.NavigateUrl Property

aspnet-devexpress-dot-web-dot-aspxhyperlink.md

latest6.3 KB
Original Source

ASPxHyperLink.NavigateUrl Property

SECURITY-RELATED CONSIDERATIONS

Using untrusted or user-specified URLs in redirect operations may direct users to malicious sites. Always use trusted, fixed endpoints to prevent open-redirect attacks.

Gets or sets an URL which defines the navigation location for the editor’s hyperlink.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string NavigateUrl { get; set; }
vb
<DefaultValue("")>
Public Property NavigateUrl As String

Property Value

TypeDefaultDescription
StringString.Empty

A String value which represents an URL to where the client web browser will navigate when a hyperlink in the editor is clicked.

|

Remarks

Use the NavigateUrl property to specify an URL to which the client web browser navigates whenever the editor’s hyperlink is clicked. If the NavigateUrl property is assigned, the editor’s caption text serves as a link. If this property is set to an empty string ( String.Empty ) no navigation is performed when clicking on the editor’s text (or image).

Example

This example demonstrates how to customize the ASPxHyperLink control.

aspx
<dx:ASPxHyperLink ID="ASPxHyperLink1" runat="server" Text="DevExpress" NavigateUrl="http://devexpress.com/" 
    ImageUrl="~/imgs/logo.png">
</dx:ASPxHyperLink>

The following code snippets (auto-collected from DevExpress Examples) contain references to the NavigateUrl property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/CS/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.cs#L53

csharp
hyperlink.Text = url;
    hyperlink.NavigateUrl = GetResolvedUrl(url);
}

aspxgridview-dataitemtemplate-runtime/CS/HyperlinkColumn/Default.aspx.cs#L61

csharp
GridViewDataItemTemplateContainer gridContainer = (GridViewDataItemTemplateContainer)container;
link.NavigateUrl = string.Format("~/details.aspx?Device={0}", gridContainer.KeyValue);
link.Text = string.Format("Get details about device {0}", gridContainer.KeyValue);

aspxgridview-hyperlink-based-on-several-cell-values/CS/Solution/Default.aspx.cs#L15

csharp
link.Target = "_blank";
    link.NavigateUrl = "Default2.aspx?id=" + container.KeyValue;
}

aspxgridview-dataitemtemplate-hyperlink-popup/CS/Solution/Default.aspx.cs#L19

csharp
link.NavigateUrl = "javascript:void(0);";
link.Text = string.Format("More Info: EAN13 - {0}", ean13);

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/VB/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.vb#L54

vb
hyperlink.Text = url
    hyperlink.NavigateUrl = GetResolvedUrl(url)
End Sub

aspxgridview-dataitemtemplate-runtime/VB/HyperlinkColumn/Default.aspx.vb#L58

vb
Dim gridContainer As GridViewDataItemTemplateContainer = CType(container, GridViewDataItemTemplateContainer)
link.NavigateUrl = String.Format("~/details.aspx?Device={0}", gridContainer.KeyValue)
link.Text = String.Format("Get details about device {0}", gridContainer.KeyValue)

aspxgridview-hyperlink-based-on-several-cell-values/VB/Solution/Default.aspx.vb#L18

vb
link.Target = "_blank"
    link.NavigateUrl = "Default2.aspx?id=" & container.KeyValue
End Sub

aspxgridview-dataitemtemplate-hyperlink-popup/VB/Solution/Default.aspx.vb#L19

vb
Dim contentUrl As String = String.Format("{0}?EAN13={1}", Session("baseURL"), ean13)
link.NavigateUrl = "javascript:void(0);"
link.Text = String.Format("More Info: EAN13 - {0}", ean13)

See Also

Text

ImageUrl

Hyperlink

ASPxHyperLink Class

ASPxHyperLink Members

DevExpress.Web Namespace