Hi Joseph,
you need to either write the logic on Textbox3's TextChanged event or you should write the logic on Button's click event.
If you are using TextBox's textChanged event then your declaration code will be
<asp:TextBox ID="TextBox3" runat="server" AutoPostBack="true" OnTextChanged="TextBox3_TextChanged"></asp:TextBox>
protected void TextBox3_TextChanged(object sender, EventArgs e)
{
if (TextBox1.Text != "" && TextBox2.Text != "")
{
TextBox3.Text = ((Convert.ToInt32(TextBox1.Text)) * (Convert.ToInt32(TextBox2.Text))).ToString();
}
}
or if you are using button, then your event will be like this
<asp:Button ID="btnCalculate" runat="server" Text="Multiply" OnClick="btnCalculate_Click" />
protected void btnCalculate_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "" && TextBox2.Text != "")
{
TextBox3.Text = ((Convert.ToInt32(TextBox1.Text)) * (Convert.ToInt32(TextBox2.Text))).ToString();
}
}
Hope this helps.