calculation between two text box
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
How do you do the coding for two textboxs to auto generate the total using asp.net? example textbox1 plus textbox2 and the answer automatically appear in the total label.
That is a stupid question! No one should response that
decimal dec1, dec2;
if (Decimal.TryParse(TextBox1.Text.Trim(), out dec1) && Decimal.TryParse(TextBox2.Text.Trim(), out dec2))
{
Label1.Text = Math.Round(Decimal.Add(dec1, dec2), 2).ToString();
}Just please don't ask how to do a subtraction....... :laugh: :laugh: