A problem with the WebBrowser control

D

Dom

I have a prgram with a webBrowser control. The user can click on a
Linked Reference and the webBrowser control shows that site.

Sometimes the URL (not my program, but the URL I am browsing to) has
an "error on page", eg, a javascript error. My program then gives a
dialog box, stating the error, and all my users think I wrote a crummy
program.

IE somehow gets around this. It will simply write the phrase "error
on page" at the status bar along the bottom of the IE window. So
somehow it is catching the error and ignoring it.

Can I do this with the WebBrowser Control? I do not see an event like
"ErrorOnPage" that I can trap and handle.

TIA,
Dom
 
P

Peter Bromberg [C# MVP]

There are settings in IE to "disable script debugging" which suppresses
these dialogs. Since the WebBrowser control wraps IE, you would probably
need to find the Registry entries to modify programmatically for your app.
Peter
 
D

Dom

There are settings in IE to "disable script debugging" which suppresses
these dialogs. Since the WebBrowser control wraps IE, you would probably
need to find the Registry entries to modify programmatically for your app.
Peter










- Show quoted text -

Your reply made me think that maybe I should be looking for a property
and not an event. Then I found a property called
"ScriptErrorsSurpressed", and that seems to have done the trick.


Dom
 
P

Peter Bromberg [C# MVP]

Excellent. Thanks for that discovery, in case I ever need it.
Peter
There are settings in IE to "disable script debugging" which suppresses
these dialogs. Since the WebBrowser control wraps IE, you would probably
need to find the Registry entries to modify programmatically for your app.
Peter










- Show quoted text -

Your reply made me think that maybe I should be looking for a property
and not an event. Then I found a property called
"ScriptErrorsSurpressed", and that seems to have done the trick.


Dom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top