Compartir a través de


HyperlinkButton.NavigateUri Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the URI to navigate to when the HyperlinkButton is clicked.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
<TypeConverterAttribute(GetType(UriTypeConverter))> _
Public Property NavigateUri As Uri
[TypeConverterAttribute(typeof(UriTypeConverter))]
public Uri NavigateUri { get; set; }
<HyperlinkButton NavigateUri="uriString"/>

Property Value

Type: System.Uri
The URI to navigate to when the HyperlinkButton is clicked.

Remarks

Dependency property identifier field: NavigateUriProperty

The specified URI must be an absolute URI or an application-relative URI.

When you use a relative URI, the Silverlight-based application must discover its application root at run time, and the application root can vary between development and production environments. The application root is required for the application to build an absolute URI from a relative URI. For more information about relative and absolute URIs, see Uri.

NoteNote:

If EnableNavigation (Silverlight Plug-in Object)on the Silverlight object is set to none, the user can only navigate to a relative URI in the current application. Attempts to navigate to an external URL will cause a SecurityException.

Version Notes

Silverlight for Windows Phone Silverlight for Windows Phone

In Silverlight for Windows Phone applications, you must specify a TargetName value for the application to properly navigate to the URI specified by NavigateUri.

Examples

The following code example demonstrates a HyperlinkButton.

<HyperlinkButton Content="Click here to learn about Silverlight"
    NavigateUri="https://www.silverlight.net" TargetName="_blank" Margin="10,60,0,0"/>

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.