后台:
protected void GV_RowCommand(object sender,GridViewCommandEventArgs e)
{
int rowIndex = Convert.ToInt32(e.CommandArgument);//获取事件行
GridViewRow gvr = GV.Rows[rowIndex];//事件行
string ID =gvr.Cells[0].Text;//根据行索引,获取行中列数据
if (e.CommandName == "Sel")
{
}
}
前台:
<asp:ButtonField CommandName="Sel" HeaderText="查看/更新" Text="查看<br/>更新<br/>" ></asp:ButtonField>