简体   繁体   English

当数据更改时异步更新asp.net中继器

[英]Asynchronously update asp.net repeater as and when data changes

I want an asp.net repeater control to update by itself as and when the actual data that it's pointing to, gets updated. 我希望一个asp.net转发器控件能够在指向的实际数据被更新时自行更新。 I'm not looking for a solution where a button click happens and each time repeater(which is inside an updatepanel) is bound to a datasource. 我不是在寻找一种解决方案,在这种解决方案中,单击按钮会发生,并且每次将重复器(位于updatepanel内)绑定到数据源。

Ex: In my page load, I have this 例如:在我的页面加载中,我有这个

Page_Load(){
   myRepeater.DataSource = ListOfStringObj;
   myRepeater.DataBind();
}

Now, if at some point ListOfStringObj gets updated, then the repeater should reflect the changes without explicitly binding it again to the datasource. 现在,如果ListOfStringObj在某个时候得到更新,则转发器应该反映更改,而无需再次将其明确绑定到数据源。 Is this even possible? 这有可能吗? I'm not particular about repeater control here, it can be a gridview as well. 我在这里并不特别关注中继器控制,它也可以是gridview。 If not can anyone please explain? 如果没有人可以解释?

PS: Something of this sort is possible using Knockout js, which is based on MVVM PS:可以使用基于MVVM的Knockout js进行此类操作

Thanks, Sharath 谢谢,Sharath

我希望此用于ASP.NET的MVVM将帮助您实现这一目标: asp.net MVVM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM