Microsoft KB Archive/327135

= BeforeNavigate2 Event of WebBrowser Control Does Not Fire =

Article ID: 327135

Article Last Modified on 10/12/2005

-

APPLIES TO


 * Microsoft .NET Framework Service Pack 1
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q327135



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



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:

http://support.microsoft.com/contactus/?ws=support

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



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



Steps to Reproduce the Behavior
 To create a new Windows Application project in Microsoft Visual Basic .NET, follow these steps:  Start Microsoft Visual Studio .NET. On the File menu, point to New, and then click Project. 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. </li> On the Tools menu, click Customize Toolbox.</li> 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.</li> Drag a WebBrowser control (look for &quot;Explorer&quot; in the toolbox) from the toolbox to Form1 to add the AxWebBrowser1 control to the Form1 class.</li>  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(&quot;http://www.msn.com&quot;) </li>  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(&quot;BeforeNavigate2 event fired&quot;) </li> 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.</li></ol>

After you install the hotfix that is listed in the &quot;Resolution&quot; section of this article, the BeforeNavigate2 event fires, and the MessageBox is displayed. <div class="references_section">