加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

当从页面导航时页面加载错误时,asp.net – signalR中断

发布时间:2020-12-16 03:34:31 所属栏目:asp.Net 来源:网络整理
导读:当导航离开具有signalR连接/连接集线器的页面时,我收到以下错误消息. The connection to “http://localhost:53604/signalr/signalr/connect?transport=serverSentEventsconnectionId=0b308c0d-2122-4e60-a9fa-f6e3f3eb1f4econnectionData=%5B%7B%22name%22%
当导航离开具有signalR连接/连接集线器的页面时,我收到以下错误消息.

The connection to “http://localhost:53604/signalr/signalr/connect?transport=serverSentEvents&connectionId=0b308c0d-2122-4e60-a9fa-f6e3f3eb1f4e&connectionData=%5B%7B%22name%22%3A%22packageactionstatus%20%22%7D%5D&tid=9” was interrupted while the page was loading.

我确实理解由于离开页面导致连接丢失(这是好的)但是在导航离开当前页面之前是否有一种安全的方法来停止连接?

解决方法

您可以关闭onunload连接:

$.connection.hub.stop();

虽然我不确定你为什么要关心这个错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读