ListView中ItemTemplate里面有包含像 linkbutton的控件,那该控件点击事件在哪设置?

shfd2011 2016-10-20 01:11:05


ListView中ItemTemplate里面有包含像 linkbutton的控件,那该控件点击事件在哪设置?

linkbutton控件,它本身有点击事件,但加到ListView1中ItemTemplate里面,怎么设定

<ItemTemplate>
<asp:LinkButton ID="LinkButton0" runat="server">
<%#"<a href=" + Eval("图片名") + "> <img src=" + Eval("图片链接") + " width=100 height=100 border=0 />"%>
</asp:LinkButton>
</ItemTemplate>

想在点击linkbutton时响应点击事件。
...全文
337 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
EnForGrass 2016-10-20
  • 打赏
  • 举报
回复
引用 2 楼 shfd2011 的回复:
[quote=引用 1 楼 Chinajiyong 的回复:] FindControl 方法 可以看看这帖子http://bbs.csdn.net/topics/350226366
你好,刚试了,FindControl它说,找不到对象。 不知有没办法遍历所有控件吗?网上都是c#代码,没有VB代码。 翻译的网站和软件几个都番不了[/quote] 看看MSDN的例子吧https://msdn.microsoft.com/en-us/library/31hxzsdw(v=vs.110).aspx
shfd2011 2016-10-20
  • 打赏
  • 举报
回复
引用 1 楼 Chinajiyong 的回复:
FindControl 方法 可以看看这帖子http://bbs.csdn.net/topics/350226366
你好,刚试了,FindControl它说,找不到对象。 不知有没办法遍历所有控件吗?网上都是c#代码,没有VB代码。 翻译的网站和软件几个都番不了
EnForGrass 2016-10-20
  • 打赏
  • 举报
回复
FindControl 方法 可以看看这帖子http://bbs.csdn.net/topics/350226366

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧