Welcome Guest Search | Active Topics | Sign In | Register

No overload for 'WebView_HandleCertError' matches delegate 'System.EventHandler<EO.WebBrowser.CertificateErrorHan Options
Eolian
Posted: Thursday, January 28, 2021 6:59:17 PM
Rank: Newbie
Groups: Member

Joined: 1/28/2021
Posts: 2
I'm trying to ignore web certificate errors.

I'm looking at this page for documentation of the function I must write: https://www.essentialobjects.com/doc/eo.webbrowser.certificateerrorhandler.aspx, where it gives this prototype:
Code: C#
public delegate void CertificateErrorHandler(
       object sender,
       CertificateErrorEventArgs e
    );

In my initialization code I am getting an error in this line:

Code: C#
webView.CertificateError += new EventHandler<CertificateErrorHandler>(WebView_HandleCertError);

My error handler function looks like this:

Code: C#
public void WebView_HandleCertError(object sender,  CertificateErrorEventArgs e) {
		e.Continue();
	}

Now as best I can tell, my error handler function exactly matches the prototype of the event handler. Yet this code will not compile, with the error message:

Quote:
No overload for 'WebView_HandleCertError' matches delegate 'System.EventHandler<EO.WebBrowser.CertificateErrorHandler>'


What am I doing wrong here???
eo_support
Posted: Friday, January 29, 2021 9:07:32 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You don't need to use System.EventHandler at all. You just use:

Code: C#
webView.CertificateError += new CertificateErrorHandler(WebView_HandleCertError);


Thanks!
Eolian
Posted: Friday, January 29, 2021 10:37:57 AM
Rank: Newbie
Groups: Member

Joined: 1/28/2021
Posts: 2
Thanks, that worked!
eo_support
Posted: Monday, February 1, 2021 10:48:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
You are welcome. Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.