推入ASP.NET通知 [英] Push Notifications in ASP.NET

查看:124
本文介绍了推入ASP.NET通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一喜,并在此先感谢 在ASP.NET: 假设我有一个网站,有很多用户。 我想告诉一个特定的用户一些事情发生了由另外一个,或者一般 任何事物一样,从另外一个传入消息。 所有应该发生的,而这个用户(谁我想通知)已经开设了网页, (比方说,一个消息框)被打开或带他去他的信息改变它的颜色链接(与出刷新网页!)。 我在阿贾克斯找了这一点,它提供了很好的事情,但不是我想要的东西, 如果有些能帮助PLZ做

First hi and thanks in advance in ASP.NET : assume that i have a web site, and there are many users. i want to inform a specific user about some thing happened by other one ,or generally any thing like an incoming message from other one . all that should be happen while this user (who i want to inform) has opened his web page , (let's say an message box) to be opened or the link that takes him to his messages changes it's color (with out refreshing the web page !). i have looked for that in ajax and it gives good things but not exactly what i want, if some can help plz do

推荐答案

这听起来像你所谈论的推通知。不幸的是,这只是不是网络的设计方式。相反,它的设置,使得用户请求一个特定的资源和网络服务器将其提供的话就可以了。一个请求总是返回只有一个响应。

It sounds like you're talking about 'push' notifications. Unfortunately, that's just not the way the web is designed. Rather, it's set up so that a user asks for a specific resource and the web server provides it if it can. One request always returns exactly one response.

这意味着你需要的模拟的创建一个渲染页面的浏览器和服务器之间的心跳的推送服务。该网页将JavaScript代码告诉浏览器定期向服务器,你有什么改变了我?您可以实现在ASP.Net AJAX使用定时器控制,但它可能会非常棘手得到它的权利。有很多小陷阱,你需要注意。

This means that you need to simulate the push service by creating a heartbeat between a rendered browser page and your server. The web page will have javascript that tells the browser to periodically ask the server, "Do you have any changes for me?" You can implement that in ASP.Net AJAX using the timer control, but it can be tricky to get it right. There are lots of little gotchas you need to watch out for.

这篇关于推入ASP.NET通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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