Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

后端 未结 2 2040
死守一世寂寞
死守一世寂寞 2021-01-27 10:07

When i am click on update button i got this error my update click event

protected void btnUpdate_Click(object sender, CommandEventArgs e)
{
    int idx = Conve         


        
2条回答
  •  忘了有多久
    2021-01-27 11:05

    No need to use e.CommandArgument to find the GridViewRow. Just do this

    GridViewRow gr = ((Button)sender).NamingContainer as GridViewRow;
    

提交回复
热议问题