Hi
there are 2 times two textbox for entering two numbers and two times a button to make the sum of them.
When i click on the second button for making the sum of the 3th and 4th textbox, the sum of the first and second textbox disappears.
How can i keep the first sum visible while i click on the second button? I tried with EnableViewState="true" but no succes.
Thanks.
V
My code:
protected void Button1_Click(object sender, EventArgs e)
{
if (int.TryParse(TextBox1.Text, out g1) && int.TryParse(TextBox2.Text, out g2))
{
int sum = g1 + g2;
Label4.Text = sum.ToString();
}
protected void Button2_Click(object sender, EventArgs e)
{
if (int.TryParse(TextBox3.Text, out g1) && int.TryParse(TextBox4.Text, out g2))
{
int sum = g1 + g2;
Label7.Text = sum.ToString();
}
}
}
Srinivasan RamamoorthiPosted Oct 15, 2021, 11:20 AM
Srinivasan RamamoorthiPosted Oct 15, 2021, 5:53 PM
Sachin SinghPosted Oct 15, 2021, 12:18 PM