Gets or sets a value indicating whether the WebBrowser displays dialog boxes such as script error messages.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Set this property to false to debug Web pages that you display in the WebBrowser control. This is useful when you use the control to add Web-based controls and scripting code to your application. It is less useful when you use the control as a generic browser. When you have finished debugging your application, set this property to true to suppress script errors.
When is set to true, the WebBrowser control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set to false and suppress script errors in a handler for the HtmlWindow::Error event. For more information, see the code example in this topic.
The following code example demonstrates how to suppress script errors without suppressing other dialog boxes. In the example, the property is set to false to ensure that dialog boxes are displayed. A handler for the HtmlWindow::Error event suppresses the error. This event is only accessible when a document is finished loading, so the handler is attached in a DocumentCompleted event handler.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.