有一个Hashtable ht, 一个 CheckBoxList1,Hashtable ht = new Hashtable();
ht.Add("aaa","1");
ht.Add("bbb","2");
ht.Add("ccc","3");
ht.Add("其它","4");请问如何在程序运行时
把 CheckBoxList1 的每个选项设置为 text="aaa" value="1" ....
ht.Add("aaa","1");
ht.Add("bbb","2");
ht.Add("ccc","3");
ht.Add("其它","4");请问如何在程序运行时
把 CheckBoxList1 的每个选项设置为 text="aaa" value="1" ....
解决方案 »
- swfupload 413 ,服务器IO错误
- 遇到一个非常奇怪的问题 (VS2008的系统问题)
- 如何在ASCX运行完之后提取出ASCX的变量呢?
- 字符串排序
- 请问在aspx.cs中如何接收来自html里post过来的文件?
- gridview嵌套gridview出现的问题
- 将此项目作为引用添加将导致循环依赖项
- 两次发言的时间间隔为20秒
- 不知道按了哪里了,IDE中代码编辑器中显示了很多向右的箭头,怎么回事啊?
- [棘手]试用版Dreamweaver修改了注册表,无法重新安装了怎么办???
- 关于Duwamish7的一个问题
- Infragistics.UltraWebGrid Client Side Program (帮顶就给分)
{
if(radiobuttonlist is RadioButtonList)
{
IDictionaryEnumerator et = ht.GetEnumerator();
int i=0;
// 作哈希表循环
while ( et.MoveNext() )
{
ListItem lt=new ListItem(ht.Keys,ht.Values);
((RadioButtonList)radiobuttonlist).Items.Add(ht);
} }
}
for(int i=0;i<ht.Count;i++)
{
.......
}
{
if(ctrls is RadioButtonList)
{
IDictionaryEnumerator et = ht.GetEnumerator();
// 作哈希表循环
while ( et.MoveNext() )
{
ListItem lt=new ListItem(ht.Keys,ht.Values);
((RadioButtonList)radiobuttonlist).Items.Add(ht);
} }
if(ctrls is CheckBoxList)
{
IDictionaryEnumerator et = ht.GetEnumerator();
// 作哈希表循环
while ( et.MoveNext() )
{
ListItem lt=new ListItem(ht.Keys,ht.Values);
((CheckBoxList)radiobuttonlist).Items.Add(ht);
}
}
}
“System.Web.UI.WebControls.ListItem.ListItem(string, string)”最匹配的重载方法具有一些无效参数