【发布时间】:2014-11-11 09:25:48
【问题描述】:
我在 gridview 中有两个按钮,但在使用“CommandName”后它们没有返回任何事件,我在其中写入函数名称但它没有做任何事情。
截图如下:
两个按钮分别是编辑和删除。
这里是sn-p:
<asp:ButtonField ButtonType="Image" ImageUrl="~/wp-content/themes/realia/assets/img/edit pencil change modify alter blue edit icon2.png" CausesValidation="true" Text="Edit" CommandName="Edit_data">
<ControlStyle Height="30px" Width="30px" />
</asp:ButtonField>
<asp:ButtonField ButtonType="Image" ImageUrl="~/wp-content/themes/realia/assets/img/500px-Delete_Icon2.png" Text="Delete">
<ControlStyle Height="30px" Width="30px" />
</asp:ButtonField>
c#:
protected void Edit_data(object sender, EventArgs e)
{
Response.Write("hello");
}
【问题讨论】:
-
你在哪里绑定了按钮上的
OnCommand事件??