protected void sgvFile1_RowDataBound(object sender, GridViewRowEventArgs e)
{ 
DropDownList ddlAM = ((DropDownList)e.Row.FindControl("ddlAM")); ddlAM.SelectedIndexChanged
+= new EventHandler(ddlAM_SelectedIndexChanged); ddlAM.SelectedIndex = -1; ddlAM.Items.FindByValue(labAM.Text).Selected = true; }

protected void ddlAM_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddlAM = (DropDownList)sender;
        string i = ddlAM.ID.Substring(ddlAM.ID.LastIndexOf("ddlAM") + 5, ddlAM.ID.Length - 5);
        bool flage = false;
        GridViewRow row = (GridViewRow)ddlAM.NamingContainer;
        Label labAMPersonID = (Label)row.FindControl("labAMPersonID" + i);

        try
        {
            UpdateKaoQin(labAMPersonID.Text, ddlAM.SelectedValue);
        }
        catch
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "result", "alert('修改失败!');", true);
        }
    }

 

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2022-03-03
  • 2021-10-02
  • 2022-01-19
  • 2022-12-23
  • 2021-06-19
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2021-12-09
  • 2021-12-29
  • 2022-01-04
  • 2021-12-29
相关资源
相似解决方案