我无法弄清楚如何在 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、rowseleted、rowcommand 等)中处理它?
我很乐意应要求详细说明我的代码。^ ^