No overload for matches delegate 'EventHandler' Error CS0123
In this post, I describe how to fix the error:
Compiler Error Message: CS0123: No overload for matches delegate 'EventHandler'
Cause
This error can occur when, in ASP.NET, you've created your own Web Control or User Control which contains an EventHandler e.g.
public event EventHandler CountChanged;
Then, when configuring the markup, you use Visual Studio to automatically create an event.
The method is automatically created in the code behind but it's missing the parameters e.g.
protected void WebUserControl_CountChanged()
Resolution
To resolve the issue, ensure the method parameters match the EventHandler e.g.
protected void WebUserControl_CountChanged(object sender, EventArgs e)
Comments
Post a Comment