我想將另一個值傳遞給方法LeCmb_Statut_SelectedIndexChanged,我該如何繼續?C#委託事件處理程序SelectedIndexChanged
我的代碼:
SqlDataReader reader = comm.ExecuteReader();
while (reader.Read())
{
...
DropDownList LeCmb_Statut = new DropDownList();
string tempLabel = reader["LIBELLE"].ToString();
string templabelVeh = reader["LIBVEH"].ToString()
}
如何傳遞這些臨時變量到LeCmb_Statut_SelectedIndexChanged
?
LeCmb_Statut.SelectedIndexChanged += new EventHandler(LeCmb_Statut_SelectedIndexChanged);
@ user609511:描述更多你有什麼和你想要達到什麼。 – abatishchev 2011-02-09 10:18:52
當前您正在爲每個記錄創建一個新的DropDownList。將項目添加到預先存在的DropDownList是否更有意義? – 2011-02-09 10:21:54