How to disable “Security Warning” window in Webbrowser control

10,505

Change ScriptErrorsSuppressed property of WebBrowser control to true.

Share:
10,505
SilverLight
Author by

SilverLight

WEB DEVELOPER & C# PROGRAMMER ASP.NET C# JQUERY JAVASCRIPT MICROSOFT AJAX MICROSOFT SQL SERVER VISUAL STUDIO

Updated on June 19, 2022

Comments

  • SilverLight
    SilverLight almost 2 years

    I'm using Webbrowser control to login to HTTPS site. but I get popup "Security Warning":

    Security Warning window

    the codes below do n't work.why?

    ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
    
        public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            return true;
        }
    

    where should i put these codes?

    also there is another old thread in stackoverflow with a codeproject link.
    it does not work too...

    How can I disable this alert?

    i am using visual studio 2010 & .net 4...

    thanks in advance

  • Scott Chamberlain
    Scott Chamberlain over 11 years
    Kuba is referring to the WebBrowser IE API control, not the .NET controll
  • Kuba Wyrostek
    Kuba Wyrostek over 11 years
    Sorry, this is IWebBrowser2's interface field; named differently in .NET. I updated my answer. Plese un-downvote.