The single click button is used to avoid multiple postbacks/callbacks to the server. This feature is useful in database and/or e-mail send scenarios when the developer should prevent submitting of identical content multiple times to the server.
As of Q3 2012, all you need to do to enable this functionality is set the SingleClick property to true. RadButton will automatically disable itself after being clicked and will re-enable itself after the request has finished.
In case the button triggers an AJAX request, make sure the button itself is included in the response, so it will be enabled after a response is received from the server.
The SingleClickText property can be used for setting the text displayed in the button while the request is being processed by the server.
The example demonstrates two scenarios:
- How to disable the RadButton when clicked and submit the content from a standard textbox.
- How to simulate a download of a file and disable the RadButton during the download process.
Note that this is a fake download and no files are downloaded on the client's machine.