你可以帮助我解决这个错误'没有重载注册匹配委托'System.EventHandler' [英] can u pls help me with this error 'no overload for registration matches delegate 'System.EventHandler'
本文介绍了你可以帮助我解决这个错误'没有重载注册匹配委托'System.EventHandler'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误抛出:
注册时没有超载匹配委托''System.EventHandler''
这里注册是一种方法。
< asp:按钮ID =注册runat =serverText =RegisterOnclick =Registration/>
error thrown:
NO overload for registration matches delegate ''System.EventHandler''
here registration is a method.
<asp:Button ID="Register" runat="server" Text="Register" Onclick="Registration" />
推荐答案
如果您在HTML中使用Registration方法作为点击目标,则必须在C#中将其声明为事件处理程序委托目标:
Becasue you are using the Registration method as a click target in your HTML, you have to declare it as a event handler delegate target in your C#:
protected void Registration(object sender, EventArgs e)
标签如下所示
The tags will be like below
<asp:button id="Register" runat="server" text="Register" onclick="Registration_Click" xmlns:asp="#unknown" />
不喜欢
not like
<asp:button id="Register" runat="server" text="Register" onclick="Registration" xmlns:asp="#unknown" />
相应地改变代码
谢谢
Change in code behind accordingly
Thanks
这篇关于你可以帮助我解决这个错误'没有重载注册匹配委托'System.EventHandler'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文