Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WebBrowser.Navigate Method (Uri, Boolean)

Loads the document at the location indicated by the specified Uri into a new browser window or into the WebBrowser control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
public void Navigate(
	Uri url,
	bool newWindow
)

Parameters

url
Type: System.Uri

A Uri representing the URL of the document to load.

newWindow
Type: System.Boolean

true to load the document into a new browser window; false to load the document into the WebBrowser control.

ExceptionCondition
ObjectDisposedException

This WebBrowser instance is no longer valid.

InvalidOperationException

A reference to an implementation of the IWebBrowser2 interface could not be retrieved from the underlying ActiveX WebBrowser control.

ArgumentException

The url parameter value does not represent an absolute URI. For more information, see Uri.IsAbsoluteUri.

The WebBrowser control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a newWindow parameter value of false, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a newWindow parameter value of true, the WebBrowser control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the NewWindow event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary.

The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the Refresh method to force the WebBrowser control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the Refresh button.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.