Reputation: 1781
I have a situation where I am using signalR and asp.net. My implementation is very similar to chat example at asp.net
My question is how do I send from code behind? All examples use an older version of SignalR.
Upvotes: 0
Views: 1423
Reputation: 7765
Inside your hub create a void
like so:
public static void UpdateClients()
{
var context = GlobalHost.ConnectionManager.GetHubContext<NameOfHub>();
context.Clients.All.ClientSideFunction();
}
then use as:
NameOfHub.UpdateClients();
Upvotes: 1