【问题标题】:Why don't I get my postback event fired when I click on the ImageButton of my ListView?为什么当我单击 ListView 的 ImageButton 时不会触发我的回发事件?
【发布时间】:2012-06-23 19:57:53
【问题描述】:

我有一个ListView 和一个ImageButton
我已经设置了ListViewOnItemCommand 事件。
我已经设置了ImageButtonCommandNameCommandArgument

由于某种原因,当我单击 ImageButton 时,不会触发回发。

我尝试用普通的<asp:Button> 做同样的事情,它没有问题。我必须将OnSubmitBehavior 设置为false

所以我尝试将 ImageButton 设置为相同,但仍然无法正常工作。

有什么想法吗?

【问题讨论】:

  • 我再次检查,ImageButton 正在 PostBack 到 Page_Load 而不是去 ListView_ItemCommand。

标签: c# asp.net listview postback imagebutton


【解决方案1】:

这将是解决此特定问题的解决方法,而不是解决方案,但这可能会对您有所帮助:

http://netpl.blogspot.com/2008/01/imagebutton-in-templatefield-does-not.html

【讨论】:

  • 是的。我实际上是这样解决的。抱歉回复晚了。
猜你喜欢
  • 2017-03-18
  • 1970-01-01
  • 2023-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-02
  • 2014-07-31
  • 1970-01-01
相关资源
最近更新 更多