Web browser 2.0....

.net , csharp Kuwait
  • 12 years ago

    Hi everyone

    I am using the web browser control in c# 2.0 and am having a little trouble!

    I can easily suppress the javascript errors dialog box (using the appropriate property) but I cannot seem to programmatically determine if there have been any javascript errors.  There must surely be a way to:

    a) Determine if there have been any JS errors after a document has loaded

    b) Traverse the error messages (with line numbers, etc...)

    Does anyone know how to get at this??



  • 12 years ago

    As this would be the active x control rather than the .NET 2.0 Framework, have you had a look at the navigateerror event?


  • 12 years ago

    I have just moved to .net 2.0 and have tried to steer away from wrapping the ActiveX browser component (as it generates HUGE assemblies!) - isn't there a way to get at this event using the flufiness of the framework?




  • 12 years ago

    I thought about the reply above and tried to see if there was a way to dig into the underlying ActiveX without generating the huge wrappers and basically doing away with the fluffy framework implementation.

    It turns out you can, all you need is a sink...!


    This example is so relevant, it could have been written specially for me!  This example shows how to subclass the webbrowser object and attach a sink in order to tack an event handler for the NavigateError event to the underlying ActiveX.  And breathe....!

    This just begs the question, why the hell did M$ not include this in the first place to save the agro of "plumbing"??!!



Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson