【发布时间】:2011-06-07 04:22:31
【问题描述】:
我无法弄清楚如何在 ITemplate 中使用我的 imagebutton(见下文)将按钮的相应行数据 (ItemID) 作为查询字符串附加。
我的 ITemplate 中的 ImageButton:
ImageButton select_button = new ImageButton();
select_button.ID = "select_button";
select_button.ImageUrl = "~/Files/System/Icons/highlighter.png";
select_button.CommandName = "Select";
select_button.ToolTip = "Select";
container.Controls.Add(select_button);
我应该在 imagebutton 的 OnClick 事件中处理它(如果是,有没有办法获取按钮所在的行)或者我可以在 GridView 事件中处理它(rowbinding、rowseted、rowcommand 等) ?
我很乐意应要求详细说明我的代码。 ^^
【问题讨论】:
标签: c# asp.net gridview itemplate