触发点击事件时出现问题 [英] problem firing click event

查看:76
本文介绍了触发点击事件时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个按钮postButton,代码为:

 <   asp:Button    运行  ="    文本  =" 完成"  ID    postButton"  onClick   ="    / >  


问题是它永远不会触发并收到错误消息
"postButton_Click is not a member of ASP:postProject_aspx"

请朋友尽快帮助我 .

解决方案

请确保在代码中包含事件postButton_Click.

尝试将其添加到您的代码中:

 受保护的  void  postButton_Click(对象发​​件人,EventArgs e)
       {
           // 您要执行的代码
       } 




希望对您有所帮助:)


I have a button postButton with code:

<asp:Button runat="server" text="Done" ID="postButton" onClick="postButton_Click" />


the problem is that it never fires and got an error message
"postButton_Click is not a member of ASP:postProject_aspx"

plz friend help me as soon as possible.

解决方案

Make sure that you have the event postButton_Click in code behind.


try adding this in your code behind:

protected void postButton_Click(object sender, EventArgs e)
       {
           //your code to execute
       }




hope it helps :)


这篇关于触发点击事件时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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