时间asp.net更新列表框 [英] Update listbox on time asp.net

查看:117
本文介绍了时间asp.net更新列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表框是从数据库中获取数据。我的问题是,我想刷新列表框每3秒,例如或某个n秒。这是可能在ASP.Net我可以更新列表框上的时间,而无需刷新整个页面?如果有可能我该怎么办呢?

I have a listbox that is getting data from the database . My problem is that i want to refresh that list box on every 3 seconds for example or some n seconds. Is this possible in ASP.Net can i update listbox on time without refreshing whole page? and if it is possible how can i do it?

确定我做对的UpdatePanel的研究,但我有问题,使得列表框和列表框刷新数据源。

Ok i did research about the updatepanel but i have problem making datasource of listbox and listbox refresh .

感谢。

推荐答案

我觉得$就应该的伟大工程,为你沿着使用JavaScript的setInterval这样的:

I think $.ajax should works great to you along with JavaScript setInterval like:

<script>
YourMethodName();

function YourMethodName()
{
  //bind your listbox using $.ajax
  setInterval(YourMethodName, 3000);
}
</script>

如果你娘家帮忙如何使用jQuery绑定列表框然后 HTTP://www.dotnetcurry .COM / ShowArticle.aspx?ID = 454 可以帮助你。

If you nee help how to bind listbox using jQuery then http://www.dotnetcurry.com/ShowArticle.aspx?ID=454 may help you.

这篇关于时间asp.net更新列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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