Criar um Repeater com List e pagar os valores contidos no Dictionary que esta dentro do List
Default.aspx
<asp:repeater id="repUsuarios" runat="server">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<itemtemplate>
<li>
<strong>
<%#((System.Collections.Generic.Dictionary<string, string>)Container.DataItem)["nome"]%>
</strong>
(<%#((System.Collections.Generic.Dictionary<string, string>)Container.DataItem)["email"]%>)
</li>
</itemtemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:repeater>
Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
list.Add(GerarDictionary("Fulano", "[email protected]")); //Adiciona itens no List
list.Add(GerarDictionary("Sicrano", "[email protected]")); //Adiciona itens no List
list.Add(GerarDictionary("Beltrano", "[email protected]")); //Adiciona itens no List
repUsuarios.DataSource = list;
repUsuarios.DataBind();
}
#region GerarDictionary - Retorna um Dictionary gerado com os valores passados por parametro
private Dictionary<string, string> GerarDictionary(string sNome, string sEmail)
{
Dictionary<string, string> _dic = new Dictionary<string, string>();
_dic.Add("nome", sNome);
_dic.Add("email", sEmail);
return _dic;
}
#endregion
Resultado: