title: How to update textbox onchange without postback?
body: <p>Is there a way to update a textbox without using postback? I'd like to populate the <code>txtDFS</code> field with the value of <code>(100 - txtStocked)</code> after the user enters data in the <code>txtStocked</code> field. </p>
  
  <p>The following code works, but it uses postback so the page refreshes. Is there a way to accomplish this without refreshing the page? </p>
  
  <pre><code>&lt;asp:TextBox ID="txtStocked" runat="server" Width="75px" AutoPostBack="true" OnTextChanged="txtStocked_TextChanged"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:TextBox ID="txtDFS" runat="server" Width="75px"&gt;&lt;/asp:TextBox&gt;
  
  protected void txtStocked_TextChanged(object sender, EventArgs e)
      {
          int stocked = Convert.ToInt16(txtStocked.Text);
          int dfs = (100 - stocked);
          txtDFS.Text = dfs.ToString();
          txtDFS.Text = txtStocked.Text;
      }
  </code></pre>