Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BeforeNavigate2 Event of WebBrowser Control Does Not Fire


View products that this article applies to.

This article was previously published under Q327135

↑ Back to the top


Symptoms

If you host the BeforeNavigate2 event of the WebBrowser control in a Microsoft Visual Studio .NET application, the event does not fire.

↑ Back to the top


Resolution

This fix was designed for computers running Microsoft .NET Framework Service Pack 1 (SP1). If you installed Microsoft .NET Framework Service Pack 2 (SP2), you receive the following error message if you try to install this fix:
Could not install Microsoft .NET Framework Hotfix (Q327135)
To install the correct hotfix on computers running Microsoft .NET Framework Service Pack 2, you must install the Post-Service Pack 2 .NET Framework Core Common Language Runtime Hotfix Package. This hotfix package includes the fix to the problem that is described in this article. It also includes other fixes. To obtain this hotfix, please refer to the following article in the Microsoft Knowledge Base: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
328544� INFO: Post-Service Pack 2 .NET Framework Core CLR Hotfix Package

A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Microsoft .NET Framework service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version        Size       File Name
   ----------------------------------------------------------
   31-Jul-2002  19:26  1.0.3705.299   1,953,792  Mscorlib.dll     
   31-Jul-2002  08:50  1.0.3705.299   2,265,088  Mscorsvr.dll     
   31-Jul-2002  08:51  1.0.3705.299   2,265,088  Mscorwks.dll     
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. To create a new Windows Application project in Microsoft Visual Basic .NET, follow these steps:
    1. Start Microsoft Visual Studio .NET.
    2. On the File menu, point to New, and then click Project.
    3. In the New Project dialog box, click Visual Basic Projects under Project Types, and then click Windows Application under Templates. Click OK to create the project. By default, Form1 is created in WindowsApplication1.
  2. On the Tools menu, click Customize Toolbox.
  3. In the Customize Toolbox dialog box, on the COM Components tab, click to select the Microsoft Web Browser check box to add a reference to it. Click OK to add the WebBrowser control to the Windows Forms toolbox.
  4. Drag a WebBrowser control (look for "Explorer" in the toolbox) from the toolbox to Form1 to add the AxWebBrowser1 control to the Form1 class.
  5. Switch to Code view of Form1.vb, and then add the following code to the New subroutine (the default constructor) that follows the call to InitializeComponent:
    AxWebBrowser1.Navigate2("http://www.msn.com")
    					
  6. In the Code window, notice the drop-down list boxes. In the leftmost list, click AxWebBrowser1. In the rightmost list, click BeforeNavigate2, and then add the following code to the event handler stub that is generated:
    MessageBox.Show("BeforeNavigate2 event fired")
    					
  7. On the Debug menu, click Start (or press F5) to run the code.

    Notice that the WebBrowser control opens the Microsoft Network Web site. However, notice that the BeforeNavigate2 event does not fire before the browser opens the site.
After you install the hotfix that is listed in the "Resolution" section of this article, the BeforeNavigate2 event fires, and the MessageBox is displayed.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
325079� BUG: The BeforeNavigate2 Event of WebBrowser Control Does Not Fire If Hosted in a Visual C# .NET Application
311298� BUG: The BeforeNavigate2 Event of the WebBrowser Control Does Not Fire If Hosted in a Visual Basic .NET Application

↑ Back to the top


Keywords: kbhotfixserver, kbbug, kbctrl, kbevent, kbfix, kbnetframe100presp3fix, kbqfe, kbqfe, KB327135

↑ Back to the top

Article Info
Article ID : 327135
Revision : 8
Created on : 10/12/2005
Published on : 10/12/2005
Exists online : False
Views : 573