Controller class Where the hub is defined
public abstract class MonitoringProfileLogChartController : Croem.NotificationManager.Website.Base.BaseController.BaseController { public ActionResult Index() { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetRegisteredContexts(); return base.TransalateToAction(result); } public ActionResult LiveMonitoringProfileLogChart() { return View(); } public ActionResult test() { return View(); } **below is rest of the code of controller where our focus should be** public JsonResult GetMonitoringProfileLogChart(string FromDate, string ToDate, int ContextId) { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetMonitoringProfileLogChart(FromDate, ToDate, ContextId); return Json(result.Model, JsonRequestBehavior.AllowGet); } public JsonResult GetMonitoringProfileLiveLogChart(string FromTime, string ToTime, string DataMinutes) { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetMonitoringProfileLiveLogChart(FromTime, ToTime, DataMinutes); IHubContext context = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); context.Clients.All.addMessage(result.Model); var hub = new MyHub(); hub.Send("", ""); return Json(result.Model, JsonRequestBehavior.AllowGet); } public JsonResult GetMonitoringProfileCombinationChart(string FromTime, string ToTime) { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetMonitoringProfileCombinationChart(FromTime, ToTime); return Json(result.Model, JsonRequestBehavior.AllowGet); } } public class MyHub : Hub { IHubContext context = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); public void Send(string name, string message) { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetMonitoringProfileLiveLogChart(null, null, null); context.Clients.All.addMessage(result.Model); } public void test() { BusinessLogicReturn result = new ProcessBusinessLogic.Logic().GetMonitoringProfileLiveLogChart(null, null, null); context.Clients.All.addMessage(result.Model); } }
Console application that is used to map server URLs
class Program { static void Main(string[] args) { string info = LoggingServer.Open(); Console.WriteLine(info); string url = "http://localhost:8080"; using (WebApp.Start<Startup>(url)) { Console.WriteLine("Server running on {0}", url); var hubs = new Croem.NotificationManager.Website.Base.Controllers.MyHub(); Console.ReadLine(); } LoggingServer.Close(); } class Startup { public void Configuration(IAppBuilder app) {
Customer Page
<!DOCTYPE html> <html> <head> <title>SignalR Live Chat</title> </head> <body> <div class="container"> <input type="text" id="message" /> <input type="button" id="sendmessage" value="Send" /> <input type="hidden" id="displayname" /> <strong>Error Count</strong> <input type="text" id="Error_count" value="0" /> <ul id="discussion"></ul> </div> <script src="Scripts/jquery-1.7.1.min.js"></script> <script src="Scripts/jquery.signalR-1.1.3.js"></script> <script src="http://localhost:8080/signalr/hubs"></script> <script type="text/javascript"> var chart; var timer; $(function () { Highcharts.setOptions({ global: { useUTC: false } }); </script> <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> </body> </html>
Actual screen
The 1st class selected is the Console application class that is used to map the server URL. The 2nd class selected is the controller class where the hub is defined. 
I had a problem when I make a MyHub call object and call it from the controller that calls the function, but on my side nothing is displayed on my page, on the other hand, when I press the submit button on the screen, it calls the same function but the output also displayed on the page. Please tell me why this happens and how to call a function from the controller so that the output is displayed on the HTML page as well. I think that I do not specify the hub URL where it should be written, and why not calling the client side function when I send it directly from the controller class instead of calling the hub function from the client side, because the chat URL on the client side is indicated, and I think that when I call the send function from the client page, the client message is executed. I could not find a way to specify the address for the hub
When I press the submit button on the screen, this message is displayed: SignalR: Triggers the addMessage client hub event on the MyHub hub.
But when I call it directly from the controller in the GetMonitoringProfileLiveLogChart function, this registration message is not displayed.
SignalR Version 1.1.3