MVC 从服务器推送通知到客户端
MVC Push notification from server to client side
这个问题听起来很蹩脚但是。
是否有任何技术可以将有关服务器状态的推送通知从服务器发送到客户端。
例如:
登录时
客户端通知顺序:
Validating User ...
Validating Digital Certificate ...
Sorting downloadable file ...
Preparing to download ...
如果不可能,那么有没有其他优雅的方法可以实现这一目标。
谢谢
您可以使用 SignalR
:
$.connection.hub.start().done(function () {
$('#sendmessage').click(function () {
// Call the Send method on the hub.
chat.server.send($('#displayname').val(), $('#message').val());
// Clear text box and reset focus for next comment.
$('#message').val('').focus();
});
});
使用更多信息:tutorial
你可以在这里使用我提供的 signalR link 看看它。
这个问题听起来很蹩脚但是。
是否有任何技术可以将有关服务器状态的推送通知从服务器发送到客户端。
例如: 登录时
客户端通知顺序:
Validating User ...
Validating Digital Certificate ...
Sorting downloadable file ...
Preparing to download ...
如果不可能,那么有没有其他优雅的方法可以实现这一目标。
谢谢
您可以使用 SignalR
:
$.connection.hub.start().done(function () {
$('#sendmessage').click(function () {
// Call the Send method on the hub.
chat.server.send($('#displayname').val(), $('#message').val());
// Clear text box and reset focus for next comment.
$('#message').val('').focus();
});
});
使用更多信息:tutorial
你可以在这里使用我提供的 signalR link 看看它。