We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : Windows Forms
Category : WebBrowser

How can I catch the BeforeNavigate2 event?

This is a known bug. See http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q311298&ID=KB;EN-US;

If you are using the second solution from our FAQ "How can I host a WebBrowser control in a Windows Form" you will not have this problem but if you use the automatically generated wrapper classes see the following solution:

John Cullen posted the following answer in the microsoft.public.dotnet.framework.interop newsgroup.

The problem of the BeforeNavigate2 event not firing in C# applications has been floating around various groups for several months. Microsoft have not yet fixed the problem, although it is documented in the knowledge base. Until they do provide a fix, I suggest the following workaround to the problem which uses the fact the the old Webbrowser_V1 BeforeNavigate event *can* be caught. Note, use of this interface is deprecated, however since there doesn’t appear to be any chance of a fix any time soon...

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.