How to get a two way work binding binding for asp.net nested repeater controls

I have the following (cropped) markup:

<asp:Repeater ID="CostCategoryRepeater" runat="server">
    <ItemTemplate>
        <div class="costCategory">
            <asp:Repeater ID="CostRepeater" runat="server" DataSource='<%# Eval("Costs")%>'>
                <ItemTemplate>
                    <tr class="oddCostRows">
                        <td class="costItemTextRight"><span><%# Eval("Variance", "{0:c0}")%></span></td>
                        <td class="costItemTextRight"><input id="SupplementAmount" class="costEntryRight" type="text" value='<%# Bind("SupplementAmount")%>' runat="server" /></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </div>
    </ItemTemplate>
</asp:Repeater>

An external DataSource repeater is installed nearby in the code. I trimmed them, but there are Eval statements that connect to the properties of an external repeater. In any case, one of the fields in the internal Repeater should be Bind instead of Eval, since I want to get the values ​​that the user enters. The ExtraAmount input element correctly takes its value when the page loads, and on the other when I check the contents of the cost list, when the form returns, there are no changes made by the user. Thank.

+3
source share
1

Bind Reapter. GridView, DetailsView FormView.

0

Source: https://habr.com/ru/post/1736593/


All Articles