Suppose I have a ChatHub class defined along with a Broadcast method.
I know how to broadcast messages to all clients if one of them sends a message, however how can I send a message to all the clients from Global.asax ?
In other words how do I get access to ChatHub from another class?
Here's a basic sample:
public class ChatHub : Hub
{
public void Broadcast(String reqMessage)
{
Clients.broadcast(reqMessage);
}
}
Your help is much appreciated.