首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

IList<Dictionary<string, string>>数据绑到repeater下

2013-03-06 
IListDictionarystring, string数据绑到repeater上如何搞?IList中是实体类的没问题。这个怎么搞?[解决

IList<Dictionary<string, string>>数据绑到repeater上
如何搞?IList中是实体类的没问题。这个怎么搞?
[解决办法]
可以。
我以前搞过,一个字段叫做“**Key**”,另外一个叫做"**value**"
慢慢试试看
[解决办法]
repeater嵌套, 或者 2层 for循环。。。


[解决办法]
((KeyValuePair<string,string>)Container.DataItem).Key 
((KeyValuePair<string,string>)Container.DataItem).Value 
Dictionary绑定到Repeater
[解决办法]
不用repeater

<%foreach (Dictionary<string, string> dic in list)
          {
              foreach (string str in dic.Keys)
              {%>
              <li><%=str%><br /><%=dic[str]%></li>
          <%}
        }%>
[解决办法]
号复杂,dictionary本身就是集合了

热点排行