Hashtable list = new Hashtable();
list.Add("ltp", "李天平");
list.Add("zs", "张三");
list.Add("ls", "李四");
this.DataList1.DataSource = list;
this.DataList1.DataBind();
<asp:DataList ID="DataList1" runat="server">
    <HeaderTemplate>
        <table width="200">
            <tr>
                <td width="100">
                    ENGLISH
                </td>
                <td>
                    中文
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table width="200">
            <tr>
                <td width="100">
                    <%# ((DictionaryEntry)Container.DataItem).Key %>
                </td>
                <td>
                    <%# ((DictionaryEntry)Container.DataItem).Value %>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:DataList>

 

相关文章:

  • 2022-12-23
  • 2021-08-13
  • 2021-11-06
  • 2021-11-20
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
猜你喜欢
  • 2021-11-14
  • 2021-12-03
  • 2022-12-23
  • 2021-12-12
  • 2021-06-15
相关资源
相似解决方案