protected void Button1_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < ListBox1.Items.Count; i++)
        {
            if (ListBox1.Items[i].Selected)
            {
                string id = ListBox1.Items[i].Value;
                string text = ListBox1.Items[i].Text;
                ListBox2.Items.Add(new ListItem(text, id));
                ListBox1.Items.RemoveAt(i);
            }
        }
    }
- 本文标题: ListBox添加集合
- 文章分类:【.NET/Web】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
- 上一篇:动态生成静态页面 ASP.NET
- 下一篇: js 获取网址参数的方法