How can I change the counter value when Button1 is clicked and if the Button2 is clicked result.Text must have a value of 10.
public partial class Exercise2 : System.Web.UI.Page
{
int counter = 1;
public void Button1(object sender, EventArgs e)
{
counter = 10;
}
public void Button2(object sender, EventArgs e)
{
result.Text = The counter value is: + counter
//Here, the counter value is always 1, I want it to be 10.
}
}