Just edit the
ItemTemplate
of the
ListView
and bind the
ImageUrl
of an
Image
control to a field that says if the user is online or not:
<itemtemplate>
<tr>
<td>
<asp:image id="isOnlineImage" runat="server" imageurl="<%# ((bool)Eval("IsOnline")) ?"online.png":"offline.png" %>" />
</td>
<td>
<asp:label id="UserNameLabel" runat="server" text="<%# Eval("UserName") %>" />
</td>
</tr>
</itemtemplate>
In that code I am assuming you have a field called
IsOnline
, and two images
online.png
and
offline.png
.
You can get the idea from that an adapt it to your logic.
hope it helps.