0

I'm struggling with this a bit. What I'm trying to achieve is to send message back to the Ajax caller (aspx page) from the server (aspx page's code behind) to update the progress of a time consuming task being done at the server.

I'm trying the following code from the code behind of the aspx page, but that doesn't seem to work!

_context = GlobalHost.ConnectionManager.GetConnectionContext<MessengerEndpoint>();
_context.Connection.Send(((Connection)_context.Connection).Identity, "hey");

Any suggestions will be greatly appreciated.

Edit: Any takers? @dfowler/@N.TaylorMullen?

Regards.

4

1 回答 1

0

首先,您可以尝试(仅尝试):

Context.Connection.Broadcast ( "hey");

如果它可以工作(我认为它会工作(,问题是Identity,所以你需要打开一个连接并将连接 ID 保存在服务器或客户端中以供以后使用。

于 2013-10-07T10:00:26.627 回答