当有人输入新数据时更新网格中的数据或类似的东西! [英] updating data in a grid or something like that when someone inputs new data !(WITHOUT ANY POSTBACKS)

查看:58
本文介绍了当有人输入新数据时更新网格中的数据或类似的东西!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象我在应用程序中有一个用于输入数据的网页,并且在它们的底部有一个网格(显示输入数据)...

imagine that i have a web page in my application for inputing data and there is a grid at the bottom of them (showing inputing data)...

我要强制此网页像Windows应用程序一样运行(意味着我在输入后不希望有任何回发,并且输入数据后应更新网格,而无需回发)...

i want to force this web page acts like a windows application (mean i do not want any postback after enter and that grid should be updated after inputing data without postback)...

想象我在PC中打开了此页面,而我的朋友也打开了此页面/我想以ajax模式输入数据时,为我的朋友更新的网格没有任何回发/如Windows应用程序...

imagine that i opened this page in my pc and my friend has opened this page too / i want when i input data in ajax mode , that grid updated for my friend without any postback / like windows application ...

计时器是执行此操作的好主意吗?

is timer a good idea for doing this ?

还是有更好的方法呢?

预先感谢

最诚挚的问候

推荐答案

您肯定会为此使用AJAX-最简单(但绝对不是最有效)的方法是将AJAX控制工具包添加到您的项目,将您的 GridView 包装在一个 UpdatePanel ,并且在页面以检查数据库,以查看是否有上次检查时更新的内容.如果发生了更改,则可以重新绑定网格,也可以手动呈现新内容(并更新UpdatePanel).

You're definitely going to have to go AJAX for this - the simplest (but definitely not the most efficient) method would be to add the AJAX Control Toolkit to your project, wrap your GridView in an UpdatePanel, and have a timer on the page to check the database to see if there's anything newer than last time you checked. If there has been a change, you can either re-databind the grid or just render that new content manually (and update the UpdatePanel).

这篇关于当有人输入新数据时更新网格中的数据或类似的东西!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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