Button.Enabled property not being set

Discussion in 'ASP .Net Web Controls' started by Rick Shide, Sep 11, 2003.

  1. Rick Shide

    Rick Shide Guest

    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
    Rick Shide, Sep 11, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    601
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. Rick Shide

    Button.Enabled property not being set

    Rick Shide, Sep 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    602
    Rick Shide
    Sep 11, 2003
  3. Keith Murray
    Replies:
    1
    Views:
    719
    Chris R. Timmons
    Oct 2, 2005
  4. Author
    Replies:
    1
    Views:
    740
    bruce barker
    Mar 10, 2009
  5. youmesee
    Replies:
    0
    Views:
    102
    youmesee
    Feb 17, 2005
Loading...

Share This Page