show the list of usernames inside a div
Posted
by
Mr_Green
on Stack Overflow
See other posts from Stack Overflow
or by Mr_Green
Published on 2012-12-08T10:34:10Z
Indexed on
2012/12/08
11:05 UTC
Read the original article
Hit count: 199
I am new to jQuery. In my project, I created one Class User
in which the code is as shown below:
static ConcurrentDictionary<string, User> _users = new ConcurrentDictionary<string, User>();
//
// some function to add values to _users list
//
public List<User> GetConnectedUsers()
{
return _users.Values.ToList();
}
I want to show this list of values in div
#showUsernames. How to do this by using jQuery?
I tried the below which is not showing anything
/*display your contacts*/
$('#showUsernames').append(function(){
chat.server.getConnectedUsers();
});
where chat.server
(signalr) calls the server-side code(Chat class)..
I think the solution has nothing to do with signalr.
If the above description is not enough then you can go through my code here
© Stack Overflow or respective owner