I'm working in a web application aspx and C#. I have two procedures in code behind.
protected void Button1_Click(object sender, EventArgs e)
{
...
int totalCost=1000;
Label7.Text = totalCost.ToString();
}
i have this code behind in in button2
protected void Button2_Click(object sender, EventArgs e)
{
...
int bCost=Convert.ToInt32(Label7.Text);
}
I first click button 1 and all is OK when I click button 2 the exeption is thrown at
int bCost=Convert.ToInt32(Label7.Text);
is
Input string was not in a correct format.
Why I can't use the Label7 value from second procedure.