SignalR cannot read property client of undefined

前端 未结 10 2289
醉话见心
醉话见心 2020-12-13 08:42

I\'m trying to add SignalR to my project (ASPNET MVC 4). But I can\'t make it work.

In the below image you can see the error I\'m receiving.

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 09:06

    I fixed that problem by changing my js code from: var myHub = $.connection.SentimentsHub; to var myHub = $.connection.sentimentsHub;

    So if you have some hub with class name TestHub you must use testHub(first letter is lowercase) name in js

提交回复
热议问题