我想得到listbox的选中值(selectvalue),应该怎么写!我在selectindexchange中写i= listbox.selectvalue 得到的是空值!给个例子!谢谢大侠!
解决方案 »
- b/s 资源管理器哪样的功能,怎么实现,急
- 求asp.net下html转pdf的好用的库
- 当在aspx中的page属性中加入codepage="936"时页面出现乱码问题?
- 这样的库结构如何写SQL读取语句?
- 关于投票系统中,投票分类,投票标题以及投票内容的设计
- 程序不断重启的问题,请了解的朋友看一下,是否.NET的问题
- 用ASP.net做web頁,在textbox里按回車,只進行了pageload事件,如何讓它相應imagebutton按鈕的click事件.50等待
- (sql server 2005)语句语法检查时提示有错误
- ASP.Net中的第二个问题
- 自己做的js图片滚动特效能在HTML下面和aspx页面下正常无限滚动,为什么套一个ASP.nte后滚动到最后一张就不滚了?
- listbox的这样功能怎么实现?
- 中小企业应用用什么php4、php5、asp.net、or asp
试试
string str=ListBox.SelectedItem.Text;
如果想得到VALUE值,
string str=ListBox.SelectedItem.Value;
==>
listbox1.SelectedItem <> nothing
{
bool ExistSign = false;
if(this.LBoxSource.Items[SourceCount].Selected == true)
{
for(int TargetCount = 0; TargetCount < this.LBoxTarget.Items.Count; TargetCount++)
{
if(this.LBoxTarget.Items[TargetCount].Text == this.LBoxSource.Items[SourceCount].Text)
{
ExistSign = true;
break;
}
}
if(ExistSign == false)
{
this.LBoxTarget.Items.Add(this.LBoxSource.Items[SourceCount].Text);
}
}
}