none
How to block Visual Basic WebBrowser Error Messages RRS feed

  • Question


  • I am creating a simple VB.NET WebBrowser to automate and simplify navigation of a web site. However on certain pages i get the following popup message. This is telling me about an error which is on the Web Site itself and thus out of my control.

    Is it possible to block these popups from my application?

    The application is for personal use, so auto-clicking yes would be an acceptable option.

    Thanks in advance

    Saturday, October 22, 2011 5:01 PM

Answers

  • Hi Michael,

    The WebBrowser control uses the IE settings, so if you disable script debugging and script error notifications in IE it should carry over to the WebBrowswer control and therefore your application.  If you want to do it in only the WebBrowser control itself, you can do:

    WebBrowser.ScriptErrorsSuppressed = True
    



    Tom Overton
    Saturday, October 22, 2011 5:11 PM

All replies

  • Hi Michael,

    The WebBrowser control uses the IE settings, so if you disable script debugging and script error notifications in IE it should carry over to the WebBrowswer control and therefore your application.  If you want to do it in only the WebBrowser control itself, you can do:

    WebBrowser.ScriptErrorsSuppressed = True
    



    Tom Overton
    Saturday, October 22, 2011 5:11 PM
  • Tom,

    You sir, are a gentleman

    Thankyou very much, not only did it work a treat but it is just one line of code :)

    Thanks again

    Saturday, October 22, 2011 5:17 PM
  • Michael,

    Yeah it's nice when it ends up being one line of code instead of "create a custom class that implements this, override that...etc"!

     


    Tom Overton
    Saturday, October 22, 2011 5:20 PM