日期:2014-05-17  浏览次数:20425 次

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本身就是集合了