Partager via


HtmlWindow.Navigate Method (Uri)

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

Opens the specified page in the current browser.

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

Syntax

'Declaration
Public Sub Navigate ( _
    navigateToUri As Uri _
)
public void Navigate(
    Uri navigateToUri
)

Parameters

  • navigateToUri
    Type: System.Uri
    The URL of the page to open.

Exceptions

Exception Condition
ArgumentNullException

navigateToUri is nulla null reference (Nothing in Visual Basic).

Remarks

This method is equivalent to the JavaScript open method with the target set to _self. For more information, see the open method in the dynamic HTML (DHTML) documentation.

Examples

The following code example demonstrates how to use this method.

System.Windows.Browser.HtmlPage.Window.Navigate( _
    New Uri("https://silverlight.net"))
System.Windows.Browser.HtmlPage.Window.Navigate(
    new Uri("https://silverlight.net"));

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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