Silverlight 刷新数据
我不知道使用 silverlight 时强制浏览器刷新的最佳方法是什么。
场景是这样的:
- 我们有一个托管在 IIS 上的 silverlight 应用程序
- 两个用户打开同一个页面,该页面包含一个包含一些记录的网格。
- 只有一个用户修改了一条记录并将数据保存到数据库中,
其他用户除非手动刷新页面,否则如何才能看到数据已被修改?
我应该实施一些自动刷新吗?
提前致谢
I don't know what is the best way to force a browser refresh when using silverlight.
The scenario is like this:
- We have a silverlight application hosted on IIS
- Two users opens the same page and that page contains a grid with some records.
- Only one of the users modify one record and save the data in the database
How can the other user see that the data has been modified unless he refreshes the page manually?
Should I implement some automatic refresh?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在你打开一罐蠕虫之前,我会仔细考虑这里的要求。网格可以编辑吗?有了自动刷新的想法,正在编辑的用户会发生什么?考虑替代方案。您能否在保存数据时检查数据是否已更改,然后向用户提供适当的消息?如果您希望数据自动刷新,您将需要查看服务器到客户端的通知,例如 WCF 双工调用或底层绑定 observablecollection 的持续轮询和刷新
I would think long and hard about the requirements here before you open up a can of worms. Is the grid editable? With the automatic refresh idea what happens to the user who is in the middle of an edit? Think about alternatives. Could you possilbly check whether the data has changed at the point of saving data and then provide an appropriate message to the user? If you want the data to automatically refresh you are going to get into looking at server to client notifications e.g WCF duplex calls or constant polling and refreshing of the underlying bound observablecollection