This is a migrated thread and some comments may be shown as answers.

Cancel / Reset Ajax request

1 Answer 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 1
Andy Green asked on 16 Jul 2010, 10:18 AM
I have a page with a RadGrid, and a refresh button that calls a rebind method on the server. The grid gets its data through the needDataSource events.

Thw page gets stuck and slows down if the refresh button is repeatedly clicked, is there a way to cancel the current ajax request and initiate a new one, or disable the button until the current ajax is completed.

Andy

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Jul 2010, 11:42 AM
Hello,


Get reference to the button and disable the button in "requestStart" event, and re-enable it in "responseEnd" event. Initially access the button in code behind and save the ClientID in a HiddenField so that you can access the control from client side.

Also, go through this help article: Disable controls during AJAX

Thanks,
Princy.
Tags
Ajax
Asked by
Andy Green
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or