Znajdź kontrolki zagnieżdżone w Kontrolce Repeatera

Próbuję znaleźć wartości TextBoxów, które są renderowane w Repeaterchociaż UserControl, tj. Repeater ma symbol zastępczy dla UserControl, a wewnątrz UserControl znajduje się znacznik TextBox. Zrobiłem to wcześniej za pomocą TextBoxesbezpośrednio w środku Repeatera wcześniej, co było dość proste i zastanawiam się, dlaczego najwyraźniej nie można tego dokonać w ten sam sposób. Oto domyślna strona z Repeater, która zawiera symbol zastępczy ...

 <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<form class="formee">
    <fieldset>
         <legend>Faculty Information</legend>
         <div class="grid-4-12">
             <asp:Label ID="lblFirstName1" runat="server" Text="First Name"></asp:Label>
             <asp:Label ID="lblFirstName2" runat="server" Text="" ></asp:Label>
             <asp:Label ID ="lblSalary" runat="server" Text="" ClientIDMode="Static"></asp:Label>
        </div>
        <div class="grid-6-12">
            <asp:Label ID="lblLastName1" runat="server" Text="Last Name"></asp:Label>
            <asp:Label ID="lblLastName2" runat="server" Text=""></asp:Label>
        </div>
    </fieldset>
</form>
<div id="repeaterDiv">
    <asp:Repeater ID="rptBudget" runat="server" ClientIDMode="Static">
        <ItemTemplate>
                <asp:PlaceHolder ID="phBudget" runat="server" EnableViewState="true" />
                    <br />
        </ItemTemplate>
    </asp:Repeater>

    <asp:Button ID="btnAddBudgetControl" runat="server" Text="Add"
                CausesValidation="false" OnClick="AddBudgetControl" CssClass="addBudgetControl"/>
    <asp:Button ID="btnDisplayEntries" runat="server" Text="Display Entries" CausesValidation="false" OnClick="DisplayEntries" />
</div>
<div>
    <asp:TextBox ID="txtTotalPercent" runat="server"  ClientIDMode="Static"></asp:TextBox>
    <asp:TextBox ID="txtGrandTotal" runat="server" ClientIDMode="Static"></asp:TextBox>
    <asp:Label ID="lblCtrls" runat="server" Text=""></asp:Label>
</div>

... i UserControl, który jest wstawiony w miejsce symbolu zastępczego ...

 <fieldset>
        <legend>Faculty Salary Form</legend>
        <table cellspacing="10" id="values">
            <tr>
                <td>
                    <asp:Label ID="lblServiceType" runat="server" Text="Service"></asp:Label>
                    <asp:DropDownList runat="server" ID="ddlServiceType" CssClass="serviceType" />
                </td>
                <td>
                    <asp:Label ID="lblSpeedCode" runat="server" Text="Speed Code"></asp:Label>
                    <asp:DropDownList runat="server" ID="ddlSpeedCode" CssClass="speedType" />
                </td>
                <td>
                    <asp:Label ID="lblPercentage" runat="server" Text="Percentage"></asp:Label>
                    <asp:Textbox ID="txtPercentage" runat="server" CssClass="percentCommitment" ClientIDMode="Static" EnableViewState="true" />
                </td>
                <td>
                    <asp:Label ID="lblTotal" runat="server" Text="Total"></asp:Label>
                    <asp:TextBox ID="txtTotal" runat="server" CssClass="amountCommitment" ClientIDMode="Static"  EnableViewState="true"/>
                </td>
                <td>
                    <asp:Button ID="btnRemove" runat="server" Text="Remove Item" OnClick="RemoveItem" ClientIDMode="Static" CssClass="btnRemove" />
                </td>
            </tr>
            <tr>
            </tr>
        </table>
    </fieldset>

... ale gdy następujący kod działa dla OnClick przycisku Display, zawsze otrzymuję wartość null dla wszystkich i wszystkich TextBoxów (i DropDowns) w UserControl ...

protected void DisplayEntries(object sender, EventArgs e)
{
    foreach (RepeaterItem repeated in rptBudget.Items)
    {
        TextBox txtPercentage = (TextBox)repeated.FindControl("txtPercentage");
        if (txtPercentage == null)
        {
            lblCtrls.Text += " null; ";
        }
        else
        {
            lblCtrls.Text += txtPercentage.Text + "; ";
        }
    }
}

Jaki jest najlepszy sposób na uzyskanie dostępu do tych wartości? Dzięki.

questionAnswers(3)

yourAnswerToTheQuestion