title: document.getElementById() not working when call javascript function from code behind in c#
body: <p>I have a javascript function that is working fine in default.aspx when click on a link button.
  However, when I call this function from code behind, it cant work. </p>
  
  <p>Here is part of my code in default.aspx :</p>
  
  <pre><code>function loadAdditionalInfoDialog(qtyId)
  {
      alert(qtyId);
      var qty = document.getElementById(qtyId).value;
      alert(qty);
  }
  </code></pre>
  
  <p>Here is part of my code in code behind (default.aspx.cs) when click on a button:</p>
  
  <pre><code>protected void btnRedeemAll_Click(object sender, EventArgs e){
      TextBox txtQty = (TextBox)itm.FindControl("txtQty");
  
      ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "&lt;script&gt;loadAdditionalInfoDialog(" + txtQty.ClientID + ")&lt;/script&gt;", false);
  }
  </code></pre>
  
  <p>The alert(qtyId) is working for both side and print out the same word. (default page and code behind).
  But code behind fail to alert(qty). Anyone know what is my problem?</p>
  
  <p>Noted that the qtyId is a text box id inside a repeater in default.aspx. </p>