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

  • Home
  • SEARCH
  • 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 8893467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:15:20+00:00 2026-06-14T23:15:20+00:00

I want to send data to a specific client. to do that I am

  • 0

I want to send data to a specific client. to do that I am trying with the following;

public Task GetWaitingOrdersCount(string id, string clientId)
    {
        DateTime today = Util.getCurrentDateTime();

      var data = 10

      return Clients.Client(Context.ConnectionId).loadOrders(data);

      //return data;
    }

In the above code, I want to send ‘data’ to the ‘clientId’ passed to this method.
BUT I m having an error in this line

 return Clients.Client(Context.ConnectionId).loadOrders(data);

And the error is

'System.Threading.Tasks.Task<object>' does not contain a definition for 'loadOrders'

the client side code

con.loadOrders = function (data) {
        loadOrders(data);

    };

function loadOrders(data) {

    $('#totalOrders').html(data);
}

Any help about the error???

EDIT:
This is my full client code..

<script type="text/javascript">
var con;
$(document).ready(function () {
    con = $.connection.messagingHub;


    $.connection.hub.start(function () {
        var myClientId = $.connection.hub.id;
        con.getWaitingOrdersCount('<%:ViewBag.rid%>',myClientId).done(function (data) {
            console.log(data);
        });
    });

    con.client.loadOrders = function (data) {
        loadOrders(data);

    };

});
function loadOrders(data) {

    $('#totalOrders').html(data);

  • 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-14T23:15:21+00:00Added an answer on June 14, 2026 at 11:15 pm

    I just tried out your code (slightly modified) and it works fine for me. What version of SignalR are you using? Judging by your server code I’d say 1.0Alpha1+ but your client code looks more like 0.5.3, that is unless your con object is assigned to $.connection.yourhub.client;

    If you update to SignalR 1.0Alpha2 and change your client code to be:

    var con = $.connection.myCon;// This is arbitrary and would change based on your naming
    
    con.client.loadOrders = function (data) {
        loadOrders(data);
    
    };
    
    function loadOrders(data) {
        $('#totalOrders').html(data);
    }
    

    That being said I believe your issue has to do with the version of SignalR you are using, server side that is: since you’re receiving a task oriented error. Another piece of information that might be beneficial would be to know how GetWaitingOrdersCount is being called. Aka is it being invoked from the client directly via: con.server.getWaitingOrdersCount or is it being called from within the hub.

    Hope this info helps!

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

Sidebar

Related Questions

I created the list that have device detected, and I want to send data
i want to send arabic data from servlet using HTTPServletResponse to client i am
Hello Sir i want send list of data to php server i use following
How can in send data to a specific connected socket in Node.js? I want
I want to send secure data(strings) from a client to a server. This is
I want to send data from server to client when server is updated. Normally
I want to be able to send messages to a specific client, I have
I want to send data from server software to client software, encrypted in such
I want to send data to a function after the default value of an
I want to send data through URL.I've tried the below code: Intent browserIntent =

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.