动态控件不触发事件. [英] Dynamic controls not firing events.

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

问题描述



我正在使用Button单击时的Click事件处理程序创建动态链接按钮控件,但未触发事件.

谁能帮忙.

Hi,

I am creating dynamic link button control with Click event handler on Button click but it not firing the event.

Can anyone help.

推荐答案

hi ......
我已经成功做到了.
我正在动态生成按钮控件&将其显示在td id为"mode"的表单元格中.我已将onClick事件附加到show方法调用上.请尝试以下代码.我希望它对您有帮助.如果您仍然没有解决问题,请向我发送代码.

代码:
hi......
i have did it successfully.
I am generating button controls dynamically & display it in table cell having td id as "mode".I have attach onClick event on which show method call.try this following code.i will hope it helps you.if still you have not resolved issue send me your code.

Code:
dim b as Button
b.Attributes.Add("OnClick", "show()")
mode.Controls.Add(b)  'mode is id of table cell


最好的


以下Stackoverflow解决方案可能会为您提供帮助.
> http://stackoverflow.com/questions/855442/asp-net-dynamically添加的linkbutton-onclick-handler-不是被称为 [ ^ ]
Below Stackoverflow solution might help you..

http://stackoverflow.com/questions/855442/asp-net-dynamically-added-linkbutton-onclick-handler-is-not-being-called[^]


这篇关于动态控件不触发事件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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