建议我...刷新页面 [英] Suggest me... for refreshing the page
本文介绍了建议我...刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试一个简单的聊天..通过使用gridview
每当我刷新页面意味着它只显示gridview中的发件人消息..
我使用'
< meta http-equiv =REFRESHcontent =1/>
我的想法是当我将光标输入文本框时意味着它不会刷新页面。
按下发送按钮意味着它将会明星刷新页面..
I trying a simple chat.. by using gridview
whenever i refreshing the page mean only it shows the sender message in gridview..
I used '
<meta http-equiv="REFRESH" content="1" />
my idea is when i enter my cursor into the textbox mean it wont refresh the page.
after pressing the send button mean it will star to refreshing the page..
推荐答案
使用刷新页面开发基于Web的聊天系统,期待来自其他玩家,计时器或其他一些事件的回复真的是抑郁的事情。如果没有更新,那就浪费了流量,如果有,你可能会有点太晚了。这都错了。显然,Web主要基于纯客户端 - 服务器技术(拉技术)和无状态协议,纯粹适用于如此明显的任务,如聊天。在某些背景下,请参阅我过去的答案:网站帐户的应用程序'信息中心' / a> [ ^ ]。
但问题确实存在一些更好的解决方案:你需要服务器推送:http://en.wikipedia.org/wiki/Server_push [ ^ ]。
这些天,聊天系统等问题通常都是通过这样的方式解决的推送产品作为SignalR:
https://en.wikipedia.org/wiki/SignalR [ ^ ],
http://www.asp.net/signalr [ ^ ]。
本教程介绍如何创建SignalR聊天应用程序: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr [ ^ ]。
此CodeProject文章也很有用: Asp.Net SignalR聊天室 [ ^ ]。
-SA
Development of the Web-based chat system using refreshing the page expecting replies from other player, on timer or some other events is really depressive thing. If there are no updates, it's a waste of traffic, if there are, you may get them a bit too late. It's all wrong. Apparently, Web, primarily based on pure client-server technology (pull technology) and stateless protocol, is purely suited for such an apparent task as chat. For some background, please see my past answer: Application 'dashboard' for website accounts[^].
But some better resolution of the problem does exist: you need server push: http://en.wikipedia.org/wiki/Server_push[^].
These days, such problems as chat systems are pretty typically solved with such a "push" product as SignalR:
https://en.wikipedia.org/wiki/SignalR[^],
http://www.asp.net/signalr[^].
This tutorial shows how to create a SignalR chat application: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr[^].
This CodeProject article can also be useful: Asp.Net SignalR Chat Room[^].
—SA
>
这篇关于建议我...刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文