Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

BeforeNavigate2 Event of WebBrowser Control Does Not Fire

Article ID: 327135 - View products that this article applies to.
This article was previously published under Q327135

On This Page

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.

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

Properties

Article ID: 327135 - Last Review: October 12, 2005 - Revision: 1.7
APPLIES TO
  • Microsoft .NET Framework Service Pack 1
  • Microsoft Internet Explorer 5.01
  • Microsoft Internet Explorer 5.5
Keywords: 
kbhotfixserver kbqfe kbbug kbctrl kbevent kbfix kbnetframe100presp3fix kbqfe KB327135
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate