Button.Enabled property not being set

R

Rick Shide

I have a server-side button on a form that is not being disabled with the
enabled property.
C# code-behind

// this is the buttons onclick handler
private void CreateMetadataButton_Click(object sender, System.EventArgs e)
{
try
{
CreateMetadataButton.Enabled = false;
// a long process occurs here, the button remains enabled.
}
finally
{
CreateMetadataButton.Enabled = true;
}
}

The button remains enabled during the processing that occurs in the click
handler.
The click handler does finish, though, before any other clicks on that
button cause the handler to be called again.
How do I get the button to disable while until the my processing is done?

Rick Shide
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top