title: Client Function Not getting called SignalR
body: <p><strong>Controller class Where Hub is defined</strong></p>
  
  <pre><code>    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&lt;MyHub&gt;();
              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&lt;MyHub&gt;();
          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);
  
          }
  
      }
  </code></pre>
  
  <p><strong>Console application which is used for mapping server url</strong></p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          string info = LoggingServer.Open();
          Console.WriteLine(info);
  
          string url = "http://localhost:8080";
          using (WebApp.Start&lt;Startup&gt;(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)
          {
              // Turn cross domain on 
              var config = new HubConfiguration { EnableCrossDomain = true };
  
              // This will map out to http://localhost:8080/signalr by default
              app.MapHubs(config);
          }
      }
  
  }
  </code></pre>
  
  <p><strong>Client Page</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;SignalR Live Chat&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&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;strong&gt;Error Count&lt;/strong&gt;
          &lt;input type="text" id="Error_count" value="0" /&gt;
          &lt;ul id="discussion"&gt;&lt;/ul&gt;
      &lt;/div&gt;
      &lt;!--Script references. --&gt;
      &lt;!--Reference the jQuery library. --&gt;
      &lt;script src="Scripts/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
      &lt;!--Reference the SignalR library. --&gt;
      &lt;script src="Scripts/jquery.signalR-1.1.3.js"&gt;&lt;/script&gt;
      &lt;!--Reference the autogenerated SignalR hub script. --&gt;
      &lt;script src="http://localhost:8080/signalr/hubs"&gt;&lt;/script&gt;
      &lt;!--Add script to update the page and send messages.--&gt;
      &lt;script type="text/javascript"&gt;
          var chart;
          var timer;
          $(function () {
  
  
  
                  Highcharts.setOptions({
                      global: {
                          useUTC: false
                      }
                  });
                  //Set the hubs URL for the connection
                  $.connection.hub.url = "http://localhost:8080/signalr";
  
                  // Declare a proxy to reference the hub.
                  var chat = $.connection.myHub;
  
                  // Create a function that the hub can call to broadcast messages.
                  chat.client.addMessage = function (data) {
  
                      dataRecieved(data);
                      clearInterval(timer);
                      timer = setInterval(function () {
                          dataNotRecieved();
                      }, 10000);
                  };
                  $.connection.hub.logging = true;
                  $.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();
                      });
                  });
  
                  $.ajax({
                      type: "GET",
                      dataType: "json",
                      data: {
                          DataMinutes: 5,
                          FromTime: null,
                          ToTime: null
                      },
                      url: "@Url.Action("GetMonitoringProfileLiveLogChart", "MonitoringProfileLogChart")",
                      success: function (data) {
                          chart = new Highcharts.Chart({
                              chart: {
                                  renderTo: 'container',
                                  type: 'spline',
                                  animation: Highcharts.svg, // don't animate in old IE
                                  marginRight: 10,
  
  
                              },
                              title: {
                                  text: 'Live Profile Monitoring'
                              },
                              xAxis: {
                                  type: 'datetime',
  
                                  tickPixelInterval: 150
                              },
                              yAxis: {
                                  title: {
                                      text: 'Value'
                                  },
                                  plotLines: [{
                                      value: 0,
                                      width: 1,
                                      color: '#808080'
                                  }]
                              },
                              tooltip: {
                                  formatter: function () {
                                      return '&lt;b&gt;' + this.series.name + '&lt;/b&gt;&lt;br/&gt;' +
                                      Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '&lt;br/&gt;' +
                                      Highcharts.numberFormat(this.y, 2);
                                  }
                              },
                              legend: {
                                  enabled: true
                              },
                              exporting: {
                                  enabled: false
                              },
                              series: data.series,
  
                          });
                      }
                  });
  
  
                  timer = setInterval(function () {
                      dataNotRecieved();
                  }, 10000);
  
                  function dataNotRecieved() {
                      var shift = false;
                      for (var j = 0; j &lt; chart.series.length; j++) {
                          if (chart.series[j].data.length &lt; 50) {
                              shift = false;
  
                          }
                          else {
                              shift = true;
                          }
                          chart.series[j].addPoint([new Date().getTime() - 4 * 1000 * 60 * 60, 0], true, shift);
                      }
  
                  }
                  function dataRecieved(data) {
                      // checking if series exsist in chart but is not in data coming from ajax call . and if it does not exsist add that series point with zero
                      var series_name_exist = 0;
                      var series_exist = 0;
                      var index = 0;
                      var shift = false;
                      var length = chart.series.length;
                      for (var j = 0; j &lt; chart.series.length; j++) {
  
                          for (var k = 0; k &lt; data.series.length; k++) {
                              if (chart.series[j].name == data.series[k].name) {
                                  series_name_exist = 1;
                                  break;
                              }
  
                          }
                          if (series_name_exist == 0) {
  
                              if (chart.series[j].data.length &lt; 50) {
                                  shift = false;
  
                              }
                              else {
                                  shift = true;
                              }
                              chart.series[j].addPoint([new Date().getTime() - 4 * 1000 * 60 * 60, 0], true, shift);
                          }
                          else {
                              series_name_exist = 0;
                          }
  
  
  
                      }
                      //  if series exist add point otherwise add series
                      for (var k = 0; k &lt; data.series.length; k++) {
  
                          for (var j = 0; j &lt; chart.series.length; j++) {
                              if (chart.series[j].name == data.series[k].name) {
                                  series_exist = 1;
                                  index = j;
                                  break;
                              }
  
                          }
                          if (series_exist == 1) {
  
                              if (chart.series[index].data.length &lt; 50) {
                                  shift = false;
  
                              }
                              else {
                                  shift = true;
                              }
                              //chart.series[index].addPoint([data.series[k].time, data.series[k].count], true, shift);
                              chart.series[index].addPoint([new Date().getTime() - 4 * 1000 * 60 * 60, data.series[k].count], true, shift);
                              series_exist = 0;
  
                          }
  
                          else {
  
                              chart.addSeries({ name: '' + data.series[k].name + '', data: [] });
                              //chart.series[length].addPoint([data.series[k].time, data.series[k].count], true);
                              chart.series[length].addPoint([new Date().getTime() - 4 * 1000 * 60 * 60, data.series[k].count], true);
                              length = length + 1;
                          }
  
  
                      }
                  }
  
  
  
                  $('#message').focus();
                  // Start the connection.
  
  
          });
  
      &lt;/script&gt;
      &lt;div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Actual screen
  <img src="https://i.stack.imgur.com/1u1Tc.png" alt="screen">
  1st Selected class is the Console application class which is used for mapping server url
  2nd Selected class is the controller class where hub is defined
  <img src="https://i.stack.imgur.com/35kDv.png" alt="directories"></p>
  
  <p>I am facing a problem when i make an object of call MyHub and call it from controller the function is getting called but nothing is displayed on my HTML page on the other hand when i press send button on screen it calls the same function but the output is also show on the page .Please tell me why is this happening and how to call function from controller so that output is shown on HTMLpage as well.I think I am not specifying hub URL where it should write and that's why it's not calling client side function when i send it directly from controller class instead of calling hub function from client side because in client side chat URL is specified  and I think that's why when i call send function from client page client add message is executed.I am unable to find a way to specify address for hub</p>
  
  <p>When I press send button on screen ,This logging message is shown: SignalR: Triggering client hub event 'addMessage' on hub 'MyHub'.".</p>
  
  <p>But when I call it direct from controller in "GetMonitoringProfileLiveLogChart" function this logging message is not shown.</p>
  
  <p><strong>SignalR version 1.1.3</strong></p>