在一个panel中动态添加几个DropDownList后,怎样才能取得到选中的那个DropDownList的值?????

解决方案 »

  1.   

    this.DropDownList1.SelectValue.ToString();
      

  2.   

    通过索引判断有没有选中.SelectIndex!=0
      

  3.   

    DropDownList1.SelectValue 这个是值DropDownList1.SelectText  这个是显示的文字
      

  4.   

    DropDownList dl = this.FindControl("生成的客户端名称");
                    if (dl != null)
                    {
                        string s = dl.SelectedValue;
                    }
      

  5.   

    panel.findcontrols("dropdownlist的id")
      

  6.   

    OnSelectedIndexChanged事件
    只要更改选择就获取。
      

  7.   

    好像是 ((DropDownList)panel.findcontrols("dropdownlist的id")).SelectedValue