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 8507979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:01:35+00:00 2026-06-11T03:01:35+00:00

im getting a prblem when i want to send data o start a sub

  • 0

im getting a prblem when i want to send data o start a sub from hub when the page is loading. ill put this sample code because is short

this is my chat.vb

 Imports System
 Imports System.Collections.Generic
 Imports System.Linq
 Imports System.Web
 Imports SignalR.Hubs

 Public Class Chat
    Inherits Hub
    Public Sub Send(message As String)
       ' Call the addMessage method on all clients
        Clients.addMessage(message)
    End Sub
 End Class

and this is my default.aspx

 <script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
 <script src="Scripts/jquery.signalR-0.5.3.js" type="text/javascript"></script>
 <script src="signalr/hubs" type="text/javascript"></script>
 <script language="javascript" type="text/javascript">
    $(function () {
        // Proxy created on the fly
        var chat = $.connection.chat;

        // Declare a function on the chat hub so the server can invoke it
        chat.addMessage = function (message) {
        $('#messages').append('<li>' + message + '</li>');
        };

        $("#broadcast").click(function () {
           // Call the chat method on the server
           chat.send($('#msg').val());
       }); 
       // Start the connection
       $.connection.hub.start();
    });
 </script>
 </head>
 <body>
   <form id="form1" runat="server">
   <div style="position: absolute; left: 0; top: 0; height: 100%; width: 100%">
     <input type="text" id="msg" />
     <input type="button" id="broadcast" value="broadcast" /> 
     <ul id="messages">
     </ul>
   </div> 
   </form>
 </body>

i dont want to press the button, i want he doit all by itself when loads the page

when i put it like this

    <script language="javascript" type="text/javascript">
      $(document).ready(function () {
        // Proxy created on the fly
        var chat = $.connection.chat;

        // Declare a function on the chat hub so the server can invoke it
        chat.addMessage = function (message) {
        $('#messages').append('<li>' + message + '</li>');
        }; 

       chat.send('Hello World');

       // Start the connection
       $.connection.hub.start();
    });
 </script>

i got an connection problem
i get this error “SignalR: Connection must be started before data can be sent. Call .start() before .send()”;

  • 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-11T03:01:37+00:00Added an answer on June 11, 2026 at 3:01 am

    You must call start before you do send.

    So:

    chat.send('Hello World');
    
    // Start the connection
    $.connection.hub.start();
    

    SHOULD BE:

    // Start the connection
    $.connection.hub.start().done(function () {
        // Call the server side function AFTER the connection has been started
        chat.send('Hello World');
    });
    

    Hope this helps!

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

Sidebar

Related Questions

i want to send data from android application to server (.NET) but it doesn't
my client have 2 server and from first server then want to send a
I want to send a array of data to kernel space , ( i
I want to send email from Android virtual machine to my gmail account. Problem:
According to http://en.wikipedia.org/wiki/Producer-consumer_problem I want to simulate P/C problem using semaphore. I am getting
i am getting problem as i have some data in a database tabel file
I'm getting really tired of trying to figure out why this code works in
My iPad app is currently built as such: xml data is pulled from my
I m working on application in which i have to send all contacts from
I am using mail function as i want to send message in a format

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.