Getting Error Using a Web Browser Control in a WinForms Application

I am trying to use the webbrowser control in a winforms application. In my application, when I try to navigate to places that work fine in IE or Chrome, I get a "Script Error" window that says that "an error occurred in the script on this page." with "Error: the object does not support this property or method." However, I can still use IE to go to the page without problems.

What am I missing?

A script error is less important to me than the fact that it behaves differently in my application than in a web browser. My question is this:

Is it possible to embed a web browser in an application. Net that will behave exactly like a standalone web browser? How?

+5
source share
3 answers

For posterity: I know that this is not a correct fix, but you can really open Internet Explorer โ†’ Tools โ†’ Internet Options โ†’ Advanced, then look in the View section for the Disable script debugging options (Internet Explorer and Others). Deselect and you will solve the problem.

Another variant:

            webBrowser1.ScriptErrorsSuppressed = true;
+7
source

IE has probably disabled error messages. A script error will probably be required.

+3
source

If this is similar to using the webbrowser control in WinMo, make sure you call InitHTMLControl. Also, in the code I wrote (webbrowser in WinMo), I also explicitly send DTM_ENABLESCRIPTING to the control. YMMV, but I'm HTH.

0
source

All Articles