【发布时间】:2011-04-25 02:51:56
【问题描述】:
我知道这是一个常见问题,但我找不到解决方案。我希望你能帮助我。 我尝试将图像按钮控件绑定到网格视图中。 我想处理单击按钮所在行的数据
我的 aspx 文件看起来像
<asp:ImageButton ID="Button1"
runat="server"
ImageUrl="~/Images/deny.png"
Height="45" Width="45"
CommandName="SelectComment"
CommandArgument='<%# Container.DataItemIndex %>' />
vb 文件看起来像
Protected Sub KontaktAnfragen_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles KontaktAnfragen.RowCommand
Dim rowIndex As Integer
Dim commentHiddenField As HiddenField
If e.CommandName = "SelectComment" Then
rowIndex = Integer.Parse(e.CommandName.ToString)
问题在于页面不处理点击。它什么都不做。它甚至不跳转到 RowCommand 函数中
最好的问候
【问题讨论】:
标签: asp.net vb.net gridview imagebutton rowcommand