这是我的场景。
我有4个中继器。3 - 嵌套和 1 完全在外面。
<asp:Repeater1
<asp:Repeater2
<asp:Repeater3
<asp:Repeater4
我现在有一个List<string> lstSelectedValues
我在中继器 2 和 3 中进行各种计算,并在各个地方构建 lstSelectedValues。最后,我有一个字符串列表,我需要将其作为中继器 4 的数据源。
现在我的问题是,我在哪里绑定这个?如果我在页面加载中这样做
Reapter1.datasource = something
(inside the item databound R-2 is called and R-3 inside R-2)
Repeater.datasouce = lstSelectedValues
这不起作用,因为此时 lstSelectedValues 为空。如果我在 itemDatabound 或 R1/R2/R3 中执行此操作,则会多次添加。R3_Unload
我在活动中尝试过。但这也行不通。任何指针都会有很大帮助。