Export (0) Print
Expand All

WebBrowser.Navigate Method (String)

Note: This method is new in the .NET Framework version 2.0.

Loads the document at the specified Uniform Resource Locator (URL) into the WebBrowser control, replacing the previous document.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public void Navigate (
	string urlString
)
public void Navigate (
	String urlString
)
public function Navigate (
	urlString : String
)

Parameters

urlString

The URL of the document to load.

Exception typeCondition

ObjectDisposedException

This WebBrowser instance is no longer valid.

InvalidOperationException

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

The WebBrowser control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the WebBrowser control navigates to the specified URI and adds it to the end of the history list. Use the GoBack method to return the control to a previous page in the navigation history. Use the GoForward method to return to a later page in the navigation history after navigating backward.

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, 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.

You can use the Navigate method to implement an address bar similar to the one in Internet Explorer.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft