mvc signalr how to display all connected users
<p>I need to build a chat using signalr and I am new in this.</p>

<p>So far I got only the chat by reading some others codes and tutorials and this is what I got:</p>

<p>on my ChatApp.Hubs I got the following code</p>

<pre><code>public static class UserHandler
{
    public static HashSet&lt;string&gt; ConnectedIds = new HashSet&lt;string&gt;();
}
public class ChatHub : Hub
{

    public void Send(string name, string message)
    {
        // Call the addNewMessageToPage method to update clients.
        Clients.All.addNewMessageToPage(name, message);
    }

    public override Task OnConnected()
    {
        UserHandler.ConnectedIds.Add(Context.ConnectionId);
        return base.OnConnected();
    }

    public override Task OnDisconnected(bool stopCalled)
    {
        UserHandler.ConnectedIds.Remove(Context.ConnectionId);
        return base.OnDisconnected(stopCalled);
    }
}
</code></pre>

<p>and my view I copy past from a tutorial</p>

<pre><code>@{
ViewBag.Title = "Chat";
}
&lt;h2&gt;Chat&lt;/h2&gt;
&lt;div class="container"&gt;
    &lt;input type="text" id="message" /&gt;
    &lt;input type="button" id="sendmessage" value="Send" /&gt;
    &lt;input type="hidden" id="displayname" /&gt;
    &lt;ul id="discussion"&gt;
    &lt;/ul&gt;
&lt;/div&gt;
@section scripts {
    &lt;!--Script references. --&gt;
    &lt;!--The jQuery library is required and is referenced by default in _Layout.cshtml. --&gt;
    &lt;!--Reference the SignalR library. --&gt;
    &lt;script src="~/Scripts/jquery.signalR-2.1.0.min.js"&gt;&lt;/script&gt;
    &lt;!--Reference the autogenerated SignalR hub script. --&gt;
    &lt;script src="~/signalr/hubs"&gt;&lt;/script&gt;
    &lt;!--SignalR script to update the chat page and send messages.--&gt; 
    &lt;script&gt;
        $(function () {
            // Reference the auto-generated proxy for the hub.  
            var chat = $.connection.chatHub;
            // Create a function that the hub can call back to display messages.
            chat.client.addNewMessageToPage = function (name, message) {
                // Add the message to the page. 
                $('#discussion').append('&lt;li&gt;&lt;strong&gt;' + htmlEncode(name) 
                    + '&lt;/strong&gt;: ' + htmlEncode(message) + '&lt;/li&gt;');
            };
            // Get the user name and store it to prepend to messages.
            $('#displayname').val(prompt('Enter your name:', ''));
            // Set initial focus to message input box.  
            $('#message').focus();
            // Start the connection.
            $.connection.hub.start().done(function () {
                $('#sendmessage').click(function () {
                    // Call the Send method on the hub. 
                    chat.server.send($('#displayname').val(), $('#message').val());
                    // Clear text box and reset focus for next comment. 
                    $('#message').val('').focus();
                });
            });
        });
        // This optional function html-encodes messages for display in the page.
        function htmlEncode(value) {
            var encodedValue = $('&lt;div /&gt;').text(value).html();
            return encodedValue;
        }
    &lt;/script&gt;
}
</code></pre>

<p>what I need now is to display all the connected users in the view<br>
Appriciate your help<br>
Thanks in advance</p>