Event Navigating
Occurs before the WebBrowser control navigates to a new web page.
event EventHandler<WebBrowserEventArgs> Navigating
Returns
- EventHandler<WebBrowserEventArgs>
- Occurs before the WebBrowser control navigates to a new web page.
Remarks
This event may be canceled to prevent navigating to this resource. Note that if the displayed HTML document has several frames, one such event will be generated per frame.
You can handle the Navigating event to cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. To cancel navigation, set the Cancel property of the events object passed to the event handler to true.
Handle the Navigated event to receive notification when the WebBrowser control finishes navigation and has begun loading the document at the new location.
Handle the Loaded event to receive notification when the WebBrowser control finishes loading the new document.
You can also use WebBrowserEventArgs object to retrieve the URL of the new document through the Url property. If the new document will be displayed in a Web page frame, you can retrieve the name of the frame through the TargetFrameName property.