SignalR Hub具有多种形式 [英] SignalR Hub with Multi Form

查看:104
本文介绍了SignalR Hub具有多种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Everyboby

我使用SignalR创建一个实时应用程序。

我按照一些示例扩展了这个想法。

现在关于这个想法,我遇到了一些问题。

我将样本申请作为'工作信息申请'。

样本项目的目标是我插入新的工作信息报名表和

另一方可以在职位列表中看到实时工作信息。我正在使用MSSQL服务器和EntityFramework。

我不想使用SqL Dependancy。该过程是当我添加新的作业数据时,后端进程将通知SignalR Hub,客户端将获得该响应。

=>请参阅示例流程 [ ^ ]

单个表单没有问题(只有一页) )JobEntry。添加作业数据后,更新作业信息对此页面的所有客户端浏览器都有效。

我不想要它。我希望从另一个页面看到它。

但是当我使用多页从SignalR Hub检索作业信息时我得到了错误。



NetworkError:404 Not Found - http:// localhost:11325 / Home / signalr / hubs

错误:SignalR:加载集线器时出错。确保您的集线器引用正确,例如< script src ='/ signalr / js'>< / script>。



我认为这是SignalR Hub初始化的问题。我初始化脚本引用所有页面。

Hi Everyboby
I create one real time application with SignalR.
I'm follow some example and extend the idea.
Now I got some issue about of that idea.
I make a sample application as 'Job Information Application'.
The sample project aim is I'm insert new job informations at Entry Form and
the other side can see in Job Listing as real time job informations comming. I'm using MSSQL server and EntityFramework.
I don't want to use SqL Dependancy. The process is when I add new jobs data, the backend process will notify to SignalR Hub and client will get that response.
=>Please see sample flow[^]
There is no issue with single form(only one page) JobEntry. After adding job data, update job informations are effect to all client browser fot this page.
I don't want it. I want to see it from another page.
But I'm get the error when I using multi page for retrieve job information from SignalR Hub.

"NetworkError: 404 Not Found - http://localhost:11325/Home/signalr/hubs"
Error: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>.

I think it is issue of SignalR Hub initialize. I'm initialize scripts reference all of page.

 <script src="~/Script/jquery-1.9.1.js"></script>
    <script src="~/Script/jquery.signalR-2.0.3.min.js"></script>
    <script src="signalr/hubs"></script>
    <script type="text/ecmascript">
        $(function () {            
            var myHub = $.connection.jobHub;
	$.connection.hub.start();
        }
</script>



但是,得到错误。所以我正在更改初始化脚本引用布局页面(母版页)并引用该布局。


But, get error.So I'm change initialize scripts reference to Layout page(Master Page) and reference that layout.

<script src="~/Scripts/jquery-2.1.0.js"></script>
    <script src="~/Script/jquery.signalR-2.0.3.min.js"></script>
    <script src="signalr/hubs"></script>



这个仍然会出错。

请帮帮我,如何使用单一轮毂 - 多种形式?

请建议任何解决方案。

全部谢谢,

  &nbs p; MinChanSike


This one is still get error.
Please help me, How to use Single Hub - Multi Form ?
Please suggest any solution.
Thanks All,
   MinChanSike

推荐答案

function (){
var myHub =
(function () { var myHub =


.connection.jobHub;
.connection.jobHub;


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



但是,得到错误。所以我更改初始化脚本引用布局页面(母版页)和引用该布局。


But, get error.So I'm change initialize scripts reference to Layout page(Master Page) and reference that layout.

<script src="~/Scripts/jquery-2.1.0.js"></script>
    <script src="~/Script/jquery.signalR-2.0.3.min.js"></script>
    <script src="signalr/hubs"></script>



这个仍然会出错。

请帮帮我,如何使用单一轮毂 - 多种形式?

请建议任何解决方案。

全部谢谢,

    MinChanSike


This one is still get error.
Please help me, How to use Single Hub - Multi Form ?
Please suggest any solution.
Thanks All,
   MinChanSike


这篇关于SignalR Hub具有多种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆