title: Simple display with OnChange event on textbox
body: <p>How to use the OnChange event to display the result on the Label1 instantly after value have enter in Textbox1 and Textbox2??</p>
  
  <pre><code>    &lt;div&gt;
               &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
               &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt;
               &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
  
           &lt;/div&gt;
  ---------------------------------------------------------------------------------------
  //Code behind
  
       int num1;
        if(!Int32.TryParse(TextBox1.Text, out num1))
        {
            Label1.Text = "Not a valid number";
            return;
        }
        int num2;
  
        if(!Int32.TryParse(TextBox2.Text, out num2))
        {
            Label1.Text = "Not a valid number";
            return;
        }
        sum = num1 + num2;
        Label1.Text = sum.ToString();
  </code></pre>