Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8899187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:47:56+00:00 2026-06-15T00:47:56+00:00

I am interested in using SignalR to provide a better user experience for some

  • 0

I am interested in using SignalR to provide a better user experience for some long-running processes in my application and have just created my first test SignalR project. I created an empty web project and then used NuGet to install the SignalR.Sample package. The StockTicker.html page example works perfectly. I then created my own Hub and test page.

using System.Threading;
using Microsoft.AspNet.SignalR.Hubs;

namespace SignalR.Test
{
   [HubName("testHub")]
   public class TestHub : Hub
   {
      public void LongRunningProcess()
      {
         Thread.Sleep(1000);
         this.Clients.Caller.updateStatus("25% Completed");
         Thread.Sleep(1000);
         this.Clients.Caller.updateStatus("50% Completed");
         Thread.Sleep(1000);
         this.Clients.Caller.updateStatus("75% Completed");
         Thread.Sleep(1000);
         this.Clients.Caller.updateStatus("Done");
      }
   }
}


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>SignalR - Long Running Process</title>
</head>
<body>
   <h1>Long Running Process</h1>

   <p>Status:</p>

   <ul id="status">
      <li>Loading hub...</li>
   </ul>

   <script src="/bundles/jquery"></script>
   <script src="/Scripts/jquery.signalR-1.0.0-alpha2.js"></script>
   <script src="/signalr/hubs"></script>
   <script type="text/javascript">
      $(function () {
         var hub = $.connection.testHub;

         hub.updateStatus = function (message) {
            $("#status").append("<li>" + message + "</li>");
         };

         $.connection.hub.start().done(function () {
            $("#status").children().first().text("Hub loaded.");
            hub.longRunningProcess();
         })
         .fail(function() {
            $("#status").children().first().text("Hub failed");
         });
      })
   </script>
</body>
</html>

When I run the page, I get the following (Firebug) error:

TypeError: hub.longRunningProcess is not a function
    hub.longRunningProcess();

If I look in /signalr/hubs I see the following script towards the end of the file:

signalR.testHub = signalR.hub.createHubProxy('testHub'); 
signalR.testHub.client = { };
signalR.testHub.server = {
    longRunningProcess: function () {
        return signalR.testHub.invoke.apply(signalR.testHub, $.merge(["LongRunningProcess"], $.makeArray(arguments)));
     }
};

Any advice/pointers on where I’m going wrong would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:47:57+00:00Added an answer on June 15, 2026 at 12:47 am

    I found the problem. The client script should looks as follows:

          $(function () {
             var hub = $.connection.testHub;
    
             hub.client.updateStatus = function (message) {
                $("#status").append("<li>" + message + "</li>");
             };
    
             $.connection.hub.start().done(function () {
                $("#status").children().first().text("Hub loaded.");
                hub.server.longRunningProcess();
             })
             .fail(function() {
                $("#status").children().first().text("Hub failed");
             });
          })
    

    Notice the addition of the .client and .server properties to the hub method declarations, e.g. hub.client.updateStatus() and hub.server.longRunningProcess()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm interested in using a CDN for storing some assets in my web application.
I am interested in using a DataObject and have been looking through the documentation.
I have a Java program performing some large analysis tasks, running through a loop
Interested in using libxml2dom in a Python script of mine to (obviously) parse some
I am interested in using CUDA to program a multi-GPU application. As far as
I`m interested in using some MOSS dll's if my solution is deployed on MOSS.
I am interested in using the SBUsesNetwork and UIRequiresPersistentWiFi keys in my application; however,
Interested in using Sphinx for my application. Planning to install their latest version which
I'm interested in using Subsonic 3.0 for developing a new ASP.Net MVC application that
I am interested in using/learning RoR in a project where I have to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.