日期:2014-05-18  浏览次数:20558 次

table里边的button控件单击事件问题
我在table里边放了个button控件,但是怎么实现button的单击事件呢?在设计界面哪里无法选种button的,怎样才能双击进入Button1_Click?

<asp:TableRow   runat= "server "   ID= "tr1 ">
                                <asp:TableCell   runat= "server "> <asp:Button   ID= "Button1 "           runat= "server "   Text= "Button "   /> </asp:TableCell>
                                <asp:TableCell   runat= "server "> <asp:TextBox   ID= "texbox1 "   runat= "server "> </asp:TextBox> </asp:TableCell>
                        </asp:TableRow>
                                                </asp:TableRow>

------解决方案--------------------
<asp:Button ID= "Button1 " runat= "server " Text= "Button " />
在这里加上点击事件:
<asp:Button ID= "Button1 " onClick= "Button1_Click " runat= "server " Text= "Button " />
然后再写Button1_Click事件。。。

------解决方案--------------------
同意ls
------解决方案--------------------
控件中加onClick事件,cs文件中写onClick中的函数代码.
------解决方案--------------------
前台:
<asp:Button ID= "Button1 " onClick= "Button1_Click " runat= "server " Text= "Button " />
加一个onClick事件

后台写上委托的事件:
protect void Button1_Click(object sender,Eventargs e)
{
..........
}
------解决方案--------------------
怎样才能双击进入Button1_Click?
不能手动双击进入添加事件,需手动添加其控件的Button1_Click
然后在后台再编辑相应的
protect void Button1_Click(object sender,Eventargs e)
{}
处理方法


------解决方案--------------------
<asp:Button ID= "Button1 " runat= "server " Text= "Button " />
加上事件:
<asp:Button ID= "Button1 " onClick= "Button1_Click " runat= "server " Text= "Button " />
protect void Button1_Click(object sender,Eventargs e)
{
//
}