protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { string expert = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); string column = ((DropDownList)GridView1.Rows[e.RowIndex].FindControl("DropDownList1")).SelectedValue; Expert ed = new Expert(); if (ed.Update_Column(expert, column)) { Response.Write("<script>alert('更新成功!');window.location=window.location;</script>"); } else { Response.Write("<script>alert('更新失败!');window.location=window.location;</script>"); } }
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { string expert = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); string column = ((DropDownList)GridView1.Rows[e.RowIndex].FindControl("DropDownList1")).SelectedValue; Expert ed = new Expert(); if (ed.Update_Column(expert, column)) { Response.Write("<script>alert('更新成功!');window.location=window.location;</script>"); } else { Response.Write("<script>alert('更新失败!');window.location=window.location;</script>"); } }