I have a SignalR hub that I successfully call from jQuery.
public class UpdateNotification : Hub { public void SendUpdate(DateTime timeStamp, string user, string entity, string message) { Clients.All.UpdateClients(timeStamp.ToString("yyyy-MM-dd HH:mm:ss"), user, entity, message); } }
update message sent successfully from JS so that
var updateNotification = $.connection.updateNotification; $.connection.hub.start({ transport: ['webSockets', 'serverSentEvents', 'longPolling'] }).done(function () { }); updateNotification.server.sendUpdate(timeStamp, user, entity, message);
and successfully got it
updateNotification.client.UpdateClients = function (timeStamp, user, entity, message) {
I cannot decide how to call sendUpdate from my controller.
source share