本文介绍了如何启用下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 protected void DropDownList2_SelectedIndexChanged(对象发件人,EventArgs e) { 尝试 { if (Label5.Text.Trim()== Label13.Text.Trim()) { DropDownList2.Enabled = 真; } SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings [ UsersConnectionString]的ConnectionString)。 dbconn.Open(); // string sqltemp =从Status_Remarks中选择OutgoingRequestID ='+ Label10.Text +' ; // SqlCommand com = new SqlCommand(sqltemp,dbconn); string sqltemp1 = update Status_Remarks set Div_Officer_Remarks =' + DropDownList1.Text + '其中OutgoingRequestID =' + Label10。文字+ '; com = new SqlCommand(sqltemp1,dbconn); com.ExecuteNonQuery(); dbconn.Close(); } 我正在使用此编码来启用Dropdownlist2,但它仍然被禁用,即使条件符合 请帮助解决解决方案 protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { try { if (Label5.Text.Trim() == Label13.Text.Trim()) { DropDownList2.Enabled = true; } SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["UsersConnectionString"].ConnectionString); dbconn.Open(); //string sqltemp = "select from Status_Remarks where OutgoingRequestID ='" + Label10.Text + "' "; //SqlCommand com = new SqlCommand(sqltemp, dbconn); string sqltemp1 = "update Status_Remarks set Div_Officer_Remarks='" + DropDownList1.Text + "'where OutgoingRequestID ='" + Label10.Text + "'"; com = new SqlCommand(sqltemp1, dbconn); com.ExecuteNonQuery(); dbconn.Close(); }I am using this coding to enable the Dropdownlist2, But it remains disabled, even when condition meetsPlease help to solve 解决方案 这篇关于如何启用下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-12 21:48