Code Behind:
public class Friends
{
public string ID { get; set; }
public string Name { get; set; }
public string Image { get; set; }
}
protected void Page_Load(object sender, EventArgs e)
{
List <Friends> friendsList = new List<Friends>();
foreach (var friend in friendz)
{
friendsList.Add(
new Friends { ID = friend.id, Name = friend.name }
);
}
this.rptFriends.DataSource = friendsList;
this.rptFriends.DataBind();
}
.aspx Page
<asp:Repeater ID="rptFriends" runat="server">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# Eval("ID") %></td>
<td><%# Eval("Name") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>