Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a listview control to show all online user now i have to give show a image in that lstview to show a user is online
Posted
Comments
Member 10793675 5-May-14 9:47am    
jjjjj

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:

ASP.NET
<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.
 
Share this answer
 
v2
Comments
Ajay Kumar Tiwari From Mumbai 25-Apr-12 5:29am    
Thank You for the answer
[no name] 25-Apr-12 9:29am    
dont forget to mark it as answer if it solves your problem, or place a comment if something is wrong with it. thanks! :)
You can refer to this link


http://forums.asp.net/t/1292817.aspx/1[^]
 
Share this answer
 
 
Share this answer
 
Comments
[no name] 23-Apr-12 12:30pm    
is on the web, not windows forms nor android...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900