In design Page
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" OnTextChanged="text2_changed" AutoPostBack="true"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</div>
</form>
In code behind
protected void text2_changed(object sender, EventArgs e)
{
try
{
int x = Convert.ToInt32(TextBox1.Text);
int y = Convert.ToInt32(TextBox2.Text);
int z = x + y;
TextBox3.Text = z.ToString();
}
catch (Exception ex)
{
Label1.Text = "There seems to be an Exception. !!" + ex.ToString();
}
}
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" OnTextChanged="text2_changed" AutoPostBack="true"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</div>
</form>
In code behind
protected void text2_changed(object sender, EventArgs e)
{
try
{
int x = Convert.ToInt32(TextBox1.Text);
int y = Convert.ToInt32(TextBox2.Text);
int z = x + y;
TextBox3.Text = z.ToString();
}
catch (Exception ex)
{
Label1.Text = "There seems to be an Exception. !!" + ex.ToString();
}
}