如何解决点击功能问题? [英] How to solve the click function problems?
本文介绍了如何解决点击功能问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了动态图像按钮..为此,我想添加onclick函数.
我想我已经正确添加了我的编码eventhougn,但点击功能未将事件称为原因?我尝试了更多的可能性吗?
Hi i have created dynamic image button ..for that i want to add onclick function .
i think i am correctly added my codings eventhougn the click funvtion does not call the event why?i have tried more possiblilities?
for (int i=0;i<dt.rows.count.i++)
{
ImageButton btn1 = new ImageButton();
btn1.ID = "btn1" + i;
btn1.ImageUrl = "images/edit.jpg";
btn1.Click += new ImageClickEventHandler(btn1_Click);
}
在这里打电话给funcitonn
here am calling funcitonn
void btn1_Click(object sender, ImageClickEventArgs e)
{
this.MpopupRuleEdit.Show();
}
此处btn1-click事件不会调用
如果我插入断点并且被控制的控件无法执行该事件,为什么?
请说希望如何解决?请尽快答复..
here the btn1-click event does not call
if i insert break point and hecked controls does not go the event why?
plz say how to solve this?reply expected soon..
推荐答案
我认为这是一个ASP.NET
问题.
因此,您是否将新创建的类型为ImageButton
的object
添加到控件(页面ControlCollection
)?如果没有,请
Controls.Add(btn1);
其中btn1
是ImageButton
的object
.
希望对您有所帮助:)
I assume this is aASP.NET
issue.
So, Did you add the newly createdobject
of TypeImageButton
to the Controls( PageControlCollection
)? If not please do so,
Controls.Add(btn1);
wherebtn1
is theobject
ofImageButton
.
Hope it helps :)
这篇关于如何解决点击功能问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文