title: Unable to retrieve the value of textbox inside repeater, when repeater is bound to datatable at postback
body: <p>I have a repeater that is bound to datatable but the last column of the repeater has a textbox (not programmatically created). I have a button but outside repeater. In button_click event i wanted to get the value entered in the textbox as well as the data in that row of the repeater. In/during postback, the datatable is again recreated and bounded to the repeater, but in the button_click event the textbox is empty (assuming that the user entered a value and click the button). I have done the rebinding which i get most of the answer when googling it. Im not sure if the databinding of the datatable to the repeater affects the textbox column since that column is not part of the datatable? How do i go about it? Please see HTML and behind the code below,</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="ucprodres-any-mfg"&gt;
          &lt;asp:Repeater ID="rptAnyMfg" runat="server" &gt;
              &lt;ItemTemplate&gt;
                  &lt;div id="ucprodres-any-mfg-row"&gt;
                      &lt;div class="ucprodres-stock manufacturer"&gt;
                          &lt;div class="ucprodres-mfg "&gt;
                              &lt;div id="ucprodres-exp-any-mfg" data-swap="-"&gt;+&lt;/div&gt;
                              &lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;%#DataBinder.Eval(Container.DataItem, "Mfg")%&gt;&lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="ucprodres-stock qty-avail"&gt;
                          &lt;%#DataBinder.Eval(Container.DataItem, "Qty")%&gt;
                      &lt;/div&gt;
                      &lt;div class="ucprodres-stock availability"&gt;
                          &lt;%#DataBinder.Eval(Container.DataItem, "Availability")%&gt;
                      &lt;/div&gt;
                      &lt;div class="ucprodres-stock unit-price"&gt;
                          &lt;%#DataBinder.Eval(Container.DataItem, "QtyRange")%&gt;
                      &lt;/div&gt;
                      &lt;div class="ucprodres-stock dollar"&gt;
                          &lt;%#DataBinder.Eval(Container.DataItem, "QtyRangePrice")%&gt;
                      &lt;/div&gt;
                      &lt;div id="txtboxID" class="ucprodres-stock qty-required" &gt;
                          &lt;asp:TextBox ID="tbxAnyMfg" runat="server" style="text-align: right"
                              ToolTip="Quantity should not be more than available quantity."&gt;&lt;/asp:TextBox&gt;
                          &lt;div class="ucprodres-txtbox-info"&gt;Quantity should not be more than available quantity&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:Repeater&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>BEHIND CODE</strong></p>
  
  <pre><code>Public Sub Button_Click(sender As Object, e As EventArgs) Handles Button.Click
  For Each rptitems As RepeaterItem In rptAnyMfg.Items
          If (rptitems.ItemType = ListItemType.Item) Or (rptitems.ItemType = ListItemType.AlternatingItem) Then
              Dim tbxQtyReqd As TextBox = rptitems.FindControl("tbxAnyMfg")
              If Not String.IsNullOrEmpty(tbxQtyReqd.Text) Then
                  If tbxQtyReqd.Text &gt; "0" Then
                      Dim mfg As String = rptitems.DataItem("Mfg").ToString
                      Dim qty As String = rptitems.DataItem("Qty").ToString
                      Dim avail As String = rptitems.DataItem("Availability").ToString
                      Dim qtyrange As String = rptitems.DataItem("QtyRange").ToString
                      Dim unitprice As String = rptitems.DataItem("QtyRangePrice").ToString
                      Dim qtyreqd As String = tbxQtyReqd.Text
                      Dim rfqpart As New Parts.InStock
                      Dim rfqpartdetails As New Parts.InStock.PartsData(mfg, qty, avail, qtyrange, unitprice, qtyreqd)
                      rfqpart.Add(rfqpartdetails)
                  End If
              End If
          End If
      Next
  End Sub
  </code></pre>