Disable button while processing

G

Guest

Does any one know if there is a way to disable Button on the web page while
the page is proceessing the command on the Server?

To stop user clicking buttons once it has started a process.
 
T

Tasos Vogiatzoglou

You should use a little trick for that as you cannot have a direct
indication that server is busy. That is, when the user presses the
button you disable it (using some client side code), so the user cannot
click again the button.

In the Page_Load method use the following (assuming your button is
called btn)

btn.Attributes["onclick"]=string.Format("{0}.disabled=true;{1};",btn.UniqueID,GetPostBackEventReference(btn));


Regards,
Tasos
 

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,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top