if(IsPostBack)
{
this.ListBox2.Items.Clear();
}
ListItem k = new ListItem();
k=this.ListBox1.SelectedItem;
int s = this.ListBox1.SelectedIndex;
if(s>=0)
{
if(s>0)
{
for(int i =0;i<s-1;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.Items.Add(k);
k=this.ListBox1.Items[s-1];
this.ListBox2.Items.Add(k);
for(int i=s+1;i<this.ListBox1.Items.Count;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.DataBind();
}
else
{
this.ListBox2.Items.Add(k);
k=this.ListBox1.Items[s];
this.ListBox2.Items.Add(k);
for(int i=s+1;i<this.ListBox1.Items.Count;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.DataBind();
}
}
{
this.ListBox2.Items.Clear();
}
ListItem k = new ListItem();
k=this.ListBox1.SelectedItem;
int s = this.ListBox1.SelectedIndex;
if(s>=0)
{
if(s>0)
{
for(int i =0;i<s-1;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.Items.Add(k);
k=this.ListBox1.Items[s-1];
this.ListBox2.Items.Add(k);
for(int i=s+1;i<this.ListBox1.Items.Count;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.DataBind();
}
else
{
this.ListBox2.Items.Add(k);
k=this.ListBox1.Items[s];
this.ListBox2.Items.Add(k);
for(int i=s+1;i<this.ListBox1.Items.Count;i++)
{
ListItem other = new ListItem();
other=this.ListBox1.Items[i];
this.ListBox2.Items.Add(other);
}
this.ListBox2.DataBind();
}
}
解决方案 »
- FreeTextBox 如何将FreeTextBOX 里面的内容导出到word
- .net 邮件系统开发技术
- ASP.ent如何查看大图
- 开发商曝房价灰色产业链:4成利润为职权部门买单
- 关于接口
- 哪位好心人给介绍几个Asp.net交流的QQ群或MSN
- Asp.net页面中是否可以弹出一个VB.net那样的对话框?
- 表格控件内插入其它控件的问题?
- Chart Control控件的运用
- 谁能帮我解释一下这些代码???
- 自动生成的TextBox控件,放在了<Table>中,现在要提取TextBox中的输入,该怎么办?
- 谁有成功安装asp.net forums 2.0 Alpha版本!!给我一份,最好是汉化了的!!!
还是指将Index为1和Index 为Count-2 的Index分别改成0 和 Count -1;