想要刷新不同页面上的记录 [英] Want to refresh records across different pages

查看:92
本文介绍了想要刷新不同页面上的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面调用A.aspx,并且在此页面上有一个带有某些记录的gridview/datagrid/listview等.在此gridview中,我有一个删除按钮,用于从数据库中删除记录.

现在我的问题是,如果用户从gridview中删除了一条记录,那么如果那时候有10个以上的用户打开了A.aspx,我将如何通知或刷新gridview.

例如:-一个A.aspx页已由10个用户打开,并且在gridview中有20条记录.现在,任何用户都从griview删除任何记录,因此只剩下9条记录,但是只有该用户知道还剩下9条记录.所以我也想通知或刷新其他9个用户.

没有Silverlight,WCF仅请ASP.Net.

I have a page call A.aspx and on this page have a gridview/datagrid/listview etc. with some records. In this gridview, I have out a delete button for delete the record from the database.

Now my question is that, If a user delete a record from gridview so how will i notify or refresh the gridview if 10 more users has opened A.aspx that time.

For Example:- A.aspx page has opened by 10 users and have 20 records in the gridview. Now any user delete any record from griview so 9 records are left but only that user know that 9 records are left. So I want to notify or refresh for other 9 users as well.

No silverlight, WCF please only ASP.Net.

推荐答案

无法刷新其他页面. ASP.NET是一个断开连接的环境,一旦呈现页面并将其发送到浏览器,服务器将不知道发生了什么,除非发生回发或其他类型的请求.没有某种类型的开放连接,您无法将内容推送到客户端.

此类问题的典型解决方案是使用JavaScript方法以指定的时间间隔刷新页面.可以使用AJAX来做到这一点,以消除页面闪烁并使其对用户不可见.
There is no way to refresh the other pages. ASP.NET is a disconnected environment, once the page is rendered and sent to the browser the server has no knowledge of what goes on unless a postback or other type of request happens. You can''t push content to the client without some type of open connection.

The typical solution for this type of problem is to have a JavaScript method to refresh the page at a specified interval. This could be done with AJAX to eliminate page flashing and make it unnoticeable to the user.


这篇关于想要刷新不同页面上的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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