'System.EventHandler' "调用方法时出错 [英] 'System.EventHandler'" Error in calling a method

查看:64
本文介绍了'System.EventHandler' "调用方法时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个弹出窗口...它有一个asp按钮...当我点击这个按钮时,我需要调用页面的.cs文件中的c_button_Click方法...

当我运行页面时,我收到编译错误..

'c_button_Click'没有超载匹配委托'System.EventHandler'

任何人都可以告诉我为什么我得到这个错误,我怎么能解决它.. ??





this is a popup... and it has a asp button... when i clicked on this button i need to call c_button_Click method that is in .cs file of the page...
As i run the page i'm getting a compilation error..
"No overload for 'c_button_Click' matches delegate 'System.EventHandler'"
can anybody tell me why i m getting this error and how can i solve it..??


<a href="#login-box-Change" popup-id="pop1" class="login-window" style="color:#558ED5">Change Password</a>
                           <div id="login-box-Change" class="login-popup">
                                <a href="#" class="close"><img src="image/close.jpg" width="20" height="20"  class="btn_close" title="Close Window" alt="Close" /></a>
                                  
                                       
                                                      Username:
                                        <asp:TextBox ID="userid" runat="server" Font-Bold="False"></asp:TextBox><br />
                                                      Old Password:
                                        <asp:TextBox ID="oldp" runat="server" Font-Bold="False" TextMode="Password"></asp:TextBox><br />
                                                    New Password:
                                        <asp:TextBox ID="newp" runat="server" Font-Bold="False" TextMode="Password"></asp:TextBox><br />
                                        Confirm New Password:
                                        <asp:TextBox ID="cnewp" runat="server" Font-Bold="False" TextMode="Password"></asp:TextBox>
                                        <br />
                                        <asp:Button ID="c_button" runat="server" Font-Bold="True" Font-Names="Constantia" ForeColor="Black" Text="Change Password" onclick="c_button_Click" />
                                        
                                        
                                
                             </div>

推荐答案

我执行了你的代码&如果我把bellow功能放在cs文件中它可以工作



i have execute your code & it work if i put bellow function in cs file

protected void c_button_Click(object sender, EventArgs e)
    {

    }





您是否在cs文件中添加了此内容?如果是的话,那么也问题持续提供

您的代码块。



Do you have added this in your cs file ? If yes ,then also issue persist provide
your code block.


您还没有发布您的点击事件代码,但我怀疑您的代码存在问题那个活动。



首先它应该是



You have not posted your click event code,but i suspect you have some problem with code of that event.

First of all it should be like

protected void yourbutton_Click(object sender, System.EventArgs e)
    {
       //your code goes here
    } 





此外,您可以参考此链接以供参考



EventHandler委托 [ ^ ]



问候......:笑:



Further you can refer to this link for reference

EventHandler Delegate[^]

Regards..:laugh:


这篇关于'System.EventHandler' &QUOT;调用方法时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆