title: How to get value of textbox in code-behind which was set by Javascript?
body: <p>I'm using ASP.net and setting the value of a textbox with Javascript. When I go to save the contents of the page I am unable to get the value of the textbox, it just comes back as nothing.</p>
  
  <p>I have tried setting the value using value, innertext and innerhtml and unable to get the value from any of them.
  Setting using JS:</p>
  
  <pre><code>document.getElementById('&lt;%= txtNettWeight.ClientID %&gt;').innerText = NettWeight;
  </code></pre>
  
  <p>On Save:</p>
  
  <pre><code>if (!string.IsNullOrEmpty(txtNettWeight.Text))
      {                                      sqlComm.Parameters.AddWithValue("@NetWeight", Convert.ToDecimal(txtNettWeight.Text));
      }
  </code></pre>