动态生成DropDownList控件

来源:互联网 发布:java第三方支付接口 编辑:程序博客网 时间:2024/06/11 18:28
  protected void butn_chick_Click(object sender,EventArgs e)
    {
       int number =Convert.ToInt32(this.txt_number.Text);//获取文本框的数字
       for (int i = 0; i < number;i++)//DropDownList控件
       {
           DropDownList aa = new DropDownList();
           aa.Items.Add(new ListItem());
           this.Panel1.Controls.Add(aa);
       }
    }
原创粉丝点击