Disable asp.net button

E

Edwin Knoppert

I'm using a asp.net button for postback purposes.
Since the postback might take some time i would also like to disable this
button.
On reload the button will be enabled again.. fine..

However, i used onclientclick and then the submit is aborted.
So i messed with some ordinary button stuff executing a click() on the
asp.net button.
Isn't there an easier way to disable this asp.net button and still have the
execute?
 
E

Edwin Knoppert

This also works (good enough for me)

<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="setTimeout( 'document.getElementById( \x22' + this.id +
'\x22 ).disabled = true;', 1 );"/>
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top