Here i have used the Dummy DataTable.
You can bind the Repeater from Database also.
Please refer this code
HTML
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<th>
User ID
</th>
<th>
User Name
</th>
<th>
Status
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblUserId" Text='<%# Eval("UserId") %>' runat="server" />
</td>
<td>
<asp:Label ID="lblUserName" Text='<%# Eval("UserName") %>' runat="server" />
</td>
<td>
<asp:Image ID="imgStatus" ImageUrl='<%# Convert.ToBoolean(Eval("IsOnline")) == true ? "green.png" : "red.png" %>'
runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("UserId", typeof(int)),
new DataColumn("UserName", typeof(string)),
new DataColumn("IsOnline",typeof(bool)) });
dt.Rows.Add(1, "John Hammond", 1);
dt.Rows.Add(2, "Mudassar Khan", 1);
dt.Rows.Add(3, "Suzanne Mathews", 0);
dt.Rows.Add(4, "Robert Schidner", 1);
Repeater1.DataSource = dt;
Repeater1.DataBind();
}
}
Screenshot