GridView1_RowUpdating 怎么用呢
protectedvoidGridView1_RowUpdating(objectsender,GridViewUpdateEventArgse){intid=Conve...
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { int id = Convert.ToInt32(this.GridView1.DataKeys[e.RowIndex]["UserId"].ToString()); string UserName = ((TextBox)(this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox"))).Text.ToString(); string Password = ((TextBox )(this.GridView1.Rows[e.RowIndex].Cells[2].FindControl("TextBox"))).Text.ToString(); string Usermark = ((TextBox)(this.GridView1.Rows[e.RowIndex].Cells[3].FindControl("TextBox"))).Text.ToString(); string strSql = "update tb_manager set UserName='" + UserName + "',Password='" + Password + "',Usermark='" + Usermark + "',where UserId=" + id;
DBManager.executeNonQuery(strSql); this.GridView1.EditIndex = -1; bindGv();
} 展开
DBManager.executeNonQuery(strSql); this.GridView1.EditIndex = -1; bindGv();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询