I have a problem in disabling the button in ASP.Net
I cannot disable the button when there is a loop
example of my code:
private void button1(object sender, EventArgs e)
{
button1.Enabled = false;
for(int i = 0; i < 1000000; i++)
{
for(int j = 0; j < 1000000; j++)
{
for(int k = 0; k < 1000000; k++)
{
}
}
}
}
I still need to wait to finish the execution of the for loop before the button will be disable.. What should I need to do to disable my button before the execution of the for loop?