NavigationFailedEventArgs.Uri Property

Gets the uniform resource identifier (URI) for the content that could not be navigated to.

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

public Uri Uri { get; private set; }

Property Value

Type: System.Uri
A value that represents the URI.

The following example shows a handler for the NavigationFailed event of the Frame class. When navigation to a page within the frame fails, a child window is displayed that contains an error message and the URI of the requested page. The code for the child window named ErrorWindow is not shown in this example, but must be included in the application for the example to work. The Handled property is set to true to indicate that the event has been handled and an exception should not be thrown.

private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
    e.Handled = true;
    ChildWindow errorWin = new ErrorWindow(e.Uri);


Supported in: 5, 4, 3

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

Community Additions