工作小结(十六)-listbox使用

1.Hashtable如何绑定到listbox

1Hashtable ht = new Hashtable();
2ht.Add("北京","010");
3ht.Add("天津","020");
4
5ListBox1.DataSource = ht;
6ListBox1.DataValueField = "Key";
7ListBox1.DataTextField = "Value";
8ListBox1.DataBind();
9

 

2.asp.net 在listbox中实现上移、下移、置顶、置底效果

 

具体实现大家可以看下面代码;

default2.aspx

 

Code

 

 

 

posted @ 2009-11-24 12:05  瑞君  Views(228)  Comments(0Edit  收藏  举报