Skip to content
Loading
unable to call hub method' +  
  •               '';  
  •   
  •       var $div = $(div); 
  •   
  •       // Send Button event  
  •       $div.find("#btnSendMessage").click(function () {  
  •           alert(chat)  
  •        //   console.log(chat.connectionid)  
  •           alert("send click")  
  •   
  •           $textBox = $div.find("#txtPrivateMessage");  
  •           var msg = $textBox.val();  
  •           alert("msg is  " + msg)  
  •           if (msg.length > 0) {  
  •               chat.server.sendPrivateMessage(userId, $("#connlbl").text(), msg, 'Click');  
  •               $textBox.val('');  
  •           }  
  •       });  
  •   
  •       // Text Box event  
  •       $div.find("#txtPrivateMessage").keyup(function (e) {  
  •           if (e.which == 13) {  
  •               $div.find("#btnSendMessage").click();  
  •           }  
  •   
  •           // Typing  
  •           $textBox = $div.find("#txtPrivateMessage");  
  •           var msg = $textBox.val();  
  •           if (msg.length > 0) {  
  •             //  chat.server.sendPrivateMessage(userId, msg, 'Type');  
  •           }  
  •           else {  
  •              // chat.server.sendPrivateMessage(userId, msg, 'Empty');  
  •           }  
  •   
  •        //   clearInterval(refreshId);  
  •        //   checkTyping(chat, userId, msg, $div, 5000);  
  •       });  
  •   
  •       AddDivToContainer($div);  
  •   }  
  • here is hub method function
    1. public void SendPrivateMessage(string toUserId,string fromuserid ,string message, string status)  
    2. {  
    3. }

    1 Reply

    Know the answer? Post it — somebody with the same question will find it here.