Skip to content

Suppressing IE script errors in C# .NET

sds

Asked Oct 9, 2006, 12:13 AM EDT1 answer
Share
LinkedInX
Hi, I’m trying to creating a HTML document object from a string containing the HTML text. The page contains some script errors and when the trying to load the HTML document the IE script errors are being displayed in the dialog box. This happens when the “Disable Script Debugging” option is not checked in the IE. But when I check the option, the errors are automatically suppressed by the browser itself. Is there any way to suppress these script errors from the .Net code. Following is the code snippet which I have used, private void createDocument(string htmlString) { object[] objArray = { htmlString }; HTMLDocument htmlDocument = new HTMLDocumentClass(); IHTMLDocument2 iHtmlDocument2 = (IHTMLDocument2)htmlDocument; iHtmlDocument2.write(objArray); } Awaiting ur earliest replies !! Thanks in advance, Anand.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi All, Got a work around for the problem myself. Thought will share with all :-) Modifed the registry keys through the code so that when the application starts the "Disable Script Debugger" key is set to "yes". This way, we can stop the script error popups. But i'm not sure will this work with all the OS. Thanks, Anand.
    0