GridView的DataKeyNames属性设为"ID,Name"
GridView1.DataKeyNames = new string[]{ "ID","Name" };

列中LinkButton的CommandName属性设为"Delete"

就可以在GridView1_RowDeleting中写代码:


DataKey key = GridView1.DataKeys[e.RowIndex];
int id = int.Parse(key[0].ToString());//得到id字段值
string name = key[1].ToString();//得到name字段值

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2021-11-14
  • 2022-12-23
  • 2022-01-06
  • 2021-12-10
猜你喜欢
  • 2021-12-26
  • 2021-10-28
  • 2021-06-23
  • 2022-12-23
  • 2022-02-10
相关资源
相似解决方案