GridView上边有个Button如何才能在点击Button时选取本行的指定记录?

解决方案 »

  1.   

    <input type=button id='<%# Eval("id")%>' onclick="Ustbwuyi('<%# Eval("id")%>')" />
    这样就获取本行的id了
      

  2.   

    可以加checkbox 进行选择
      

  3.   

    我的知识库中有gridview的常见用法http://60.218.11.205/myfotodemo/tools/knowledgebase.aspx
      

  4.   

    if (e.CommandName == "Test")
    {
       GridViewRow row = (GridViewRow)((Control)e.CommandSource).Parent.Parent;
       //...  row.Cells[1].Text;  
    }