title: how to find textbox value in repeater when click on anchor link
body: <p>I have a repeter in which there is textbox .Now I want to get the value of  textbox  (txtDestroyQty) when user click on link.</p>
  
  <pre><code>&lt;asp:Repeater ID="rptDestroy" runat="server"  &gt;
      &lt;ItemTemplate&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;%#Eval("productName") %&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%#Eval("ProductId") %&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%#Eval("Attid") %&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%#Eval("vname") %&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%#Eval("PendingQty") %&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtDestroyQty" CssClass="txt" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;a href="javascript:Destroy('&lt;%#Eval("vendorId") %&gt;','&lt;%#Eval("ProductId") %&gt;','&lt;%#Eval("Attid") %&gt;')"&gt;Destroy&lt;/a&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>I have this jQuery:</p>
  
  <pre><code>function Destroy(vid, Pid, Attid) {
      var obj = {};
      obj.vid = vid;
      obj.pid = Pid;
      obj.attid = Attid;
      obj.pendingqty = pendingqty;
      $.ajax({
          type: "POST",
          url: "/stocks/Rejection.aspx/DestroyItem",
          data: JSON.stringify(obj),
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: function (data) {
  
              if (data.d == "Y")
                  window.location.href = '/stocks/rejection.aspx';
              else
                  alert('Not Destroyed');
  
          },
          error: function (result) {
              alert('went wrong');
          }
  
      });
  }
  </code></pre>
  
  <p>I tried this</p>
  
  <pre><code>var pendingqty = $('#txtDestroyQty').val();
  var value = $(this).closest('tr').find('input.txt').val();
  </code></pre>