(请高手帮忙)关于ListBox的问题!!(急!!!在线等!!)
private void btn_bumenOK_Click(object sender, System.EventArgs e)
{
if(this.DropDownList_BuMen.SelectedIndex==0)
{
Response.Write ("<script>window.alert('请你正确选择哪部门!!')</script>");
return;
}
this.ListBox_username.DataSource=null;
this.ListBox_username.DataBind();
if(this.DropDownList_BuMen.SelectedIndex==1)
department_id=3;
if(this.DropDownList_BuMen.SelectedIndex==2)
department_id=4;
if(this.DropDownList_BuMen.SelectedIndex==3)
department_id=5;
ZJLLddwJHCKFS.get_department_id=department_id;
dszhiyuan=ZJLLddwJHCKFS.ds_bumen();
dtzhiyuan=dszhiyuan.Tables["bumenusername"];
foreach(DataRow dr in dtzhiyuan.Rows)
{
this.ListBox_username.Items.Add(dr["username"].ToString());
}
为什么我第二次按了btn_bumenOK按钮后第一次的还在啊??
这是怎么回事?
请高手们帮忙,万分感激!