简体   繁体   English

绑定数据后,ASP转发器未更新

[英]ASP Repeater Not Updating After Databind

Kind of a complicated question, but I have a custom user control ("roster list") which contains an ASP Repeater. 有点复杂的问题,但是我有一个自定义用户控件(“列表”),其中包含一个ASP转发器。 This control has a method called RefreshRosterList that gets called on Page_Load of the control. 该控件有一个称为RefreshRosterList的方法,该方法在控件的Page_Load上调用。 This control gets dynamically inserted into an UpdatePanel. 该控件被动态插入到UpdatePanel中。

The master page contains two update panels - one for my roster list, one for other controls. 母版页包含两个更新面板-一个用于我的名册列表,一个用于其他控件。

I have a separate control that causes a postback. 我有一个单独的控件,导致回发。 This control ("merge courses") inserts a new record into a database and calls my RefreshRosterList method. 此控件(“合并课程”)将新记录插入数据库中,并调用我的RefreshRosterList方法。

At the end of my RefreshRosterList method is a call to databind my Repeater with new data. 在RefreshRosterList方法的末尾,是一个调用,以将我的Repeater与新数据绑定。 I know the data is correct when it binds to the Repeater. 我知道绑定到中继器时数据是正确的。

I say it's not updating, but I've figured out the Repeater will show the new item if I commit a second post back. 我说它没有更新,但是我发现如果我再提交第二篇文章,Repeater将显示新项目。 What I mean by that is if I create a merge of CIS161-01 and CIS161-02 called CIS161, it won't show. 我的意思是,如果我创建CIS161-01和CIS161-02的合并,称为CIS161,它将不会显示。 After that's merged, if I create a second merge of CIS171-01 and CIS171-02 called CIS171, that's when the CIS161 merge will show but the CIS171 merge will not. 合并之后,如果我创建了CIS171-01和CIS171-02的第二个合并,称为CIS171,那时候将显示CIS161合并,但不显示CIS171合并。

How can I get my first merge to show on databind? 如何使我的第一次合并显示在databind上?

I hope this makes sense. 我希望这是有道理的。 I can try to provide whatever code necessary, but it's spread out over many different files. 我可以尝试提供任何必要的代码,但是它分布在许多不同的文件中。

您需要将控件设置为名册列表所在的更新面板的触发器,或者自己触发更新。

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

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