Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Suppress Javascript Errors in web browser control.

$
0
0

Hi,

   I am using .NET web browser control. I want to suppress all the javascript errors,but not other box like security alert. so webbrowser.suppressjavascript = true will not work here.

  I found the following solution on msdn.

 privatevoid SuppressScriptErrors()

{
if (webBrowser1.Document != null)
        { webBrowser1.Document.Window.Error +=new    HtmlElementErrorEventHandler(scriptWindow_Error); } }privatevoid scriptWindow_Error(object sender, HtmlElementErrorEventArgs e) { MessageBox.Show("Suppressed error!"); e.Handled = true

; }

    But its not wokring properly. I m still getting javascript error popups.

    Can anybody help me asap?

Mehul


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>