如何在gridview点击一个linkbutton获取当前行关键字

2024-11-13 12:57:28
推荐回答(1个)
回答1:

GridViewRow gvr = (GridViewRow)((LinkButton)sender).Parent.Parent;
string petID = this.GridView1.DataKeys[gvr.RowIndex].ToString();