protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
Users user = new Users();
user.UserID = Convert.ToInt32((GridView1.Rows[e.RowIndex].FindControl("Label1") as Label).Text);
user.UserName = (GridView1.Rows[e.RowIndex].FindControl("TextBox2") as TextBox).Text.ToString();
user.Password = (GridView1.Rows[e.RowIndex].FindControl("TextBox3") as TextBox).Text.ToString();
bool bol = DiaryBLL.UserManage.Modify(user);
if (bol)
{
Response.Write("alert('修改成功')");
GridView1.EditIndex = -1;
Bind();
}
else
{
Response.Write("alert('修改失败');");
}
}
}
逻辑上面没有问题,就是修改行的数据(修改用户信息)。具体的,你得自己设置断点单步调试看下是否真实的获取了数据,修改了数据。
最 后 多 了 一 个 大 括 号