我正在尝试从gridview获取行单元格值,将其转换为int32然后将其分配给模型ID ..我收到此错误。任何人??
.cs删除按钮代码
protected void btnDelete_Click(object sender, EventArgs e)
{
Button btn = sender as Button;
--> Error Line-->> int rowindex = Convert.ToInt32(btn.Attributes["RowIndex"]);
muser.ID = Convert.ToInt32(GVUsers.Rows[rowindex].Cells[0].Text);
DataSet ds = new DataSet();
ds = cUser.deleteUser(muser);
fillGrid();
}
我试过了:
Int32.Parse(GVUsers.Rows[rowindex].Cells[0].Text);
但它不起作用..
提前致谢。