Поделиться через


HtmlWindow.Navigate Method (Uri, String, String)

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

Opens the specified page in the specified browser instance, with the indicated user interface features.

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

Syntax

'Declaration
Public Function Navigate ( _
    navigateToUri As Uri, _
    target As String, _
    targetFeatures As String _
) As HtmlWindow
public HtmlWindow Navigate(
    Uri navigateToUri,
    string target,
    string targetFeatures
)

Parameters

  • navigateToUri
    Type: System.Uri
    The URL of the page to open.
  • target
    Type: System.String
    The name of the window or tab that navigateToUri should be opened in.
  • targetFeatures
    Type: System.String
    A comma-delimited list of browser-specific features.

Return Value

Type: System.Windows.Browser.HtmlWindow
A reference to the underlying window object that represents the new browser.

Exceptions

Exception Condition
ArgumentNullException

navigateToUri, target, or targetFeatures is nulla null reference (Nothing in Visual Basic).

Remarks

This method overload gives you the ability to open a new page in an existing browser instance other than the current browser. It is equivalent to the JavaScript open method with the target property set to the name of an existing browser.

The target parameter specifies the name of the browser instance that the navigateToUri address should be opened in:

  • If target specifies an existing browser, the URL is loaded into that browser.

  • If the target parameter is an empty string, the method functions like the Navigate(Uri) method overload, and the URL is loaded into the current browser.

NoteNote:

Your system and browser configuration settings control whether browser instances are displayed as windows, tabs, or multiple-document interface (MDI) child windows.

The targetFeatures parameter is a string that contains a comma-delimited list of features that are browser-specific. This parameter controls browser features that are displayed when the user navigates to a new page or opens a new window.

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"), "_blank", _
    "height=300,width=600,top=100,left=100")
System.Windows.Browser.HtmlPage.Window.Navigate(
    new Uri("https://silverlight.net"), 
    "_blank", "height=300,width=600,top=100,left=100");

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.