且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

数据库更改时如何通知/更新Gridview

更新时间:2023-10-08 10:56:52

有没有办法可以更新gridview /数据库中发生更改时的整个页面.
内部的计时器线程可以使用AJAX跟踪记录计数.但是,如果存在大量并发用户,这将影响性能.

因此,请在页面上执行固定的自动定期刷新或用户驱动的硬刷新按钮.
Is there a way we can update the gridview/the entire page when a change takes place in database.
A timer thread internally can keep track of the records count using AJAX. But this would affect performance if lots of concurrent users are present.

So, do a fixed automatic periodic refresh or a user driven hard refresh button on the page.


退后一步,了解它们在Web应用程序中的工作方式.
1)Web应用程序中的所有内容都基于请求/响应系统,不存在推送机制.
2)由于第1点,您必须从客户端驱动此同步.大多数人可能会使用一个系统,通过该系统定期与服务器进行检查,以查看是否有可用的更新.
Take a step back and understand how things work in web applications.
1) Everything in a web application is based on a request/response system, a push mechanism does not exist.
2) Because of point 1, you would have to drive this synchronization from your client. Most people would probably use a system by which they periodically check the with the server to see if any updates are available.