RadAjaxPanel exposes a rich set of client-side events which allow for
easy and flexible use in a wide range of application scenarios:
-
OnRequestStart
-- fired when a request to the server is started.
- OnRequestSent
-- fired when a request is sent to the server.
- OnResponseReceived
-- fired when a response is received from the server.
- OnResponseEnd
-- fired when a response from the server is processed.
This example demonstrates the use of
RadAjaxPanel in a typical order
payment system.
The
OnRequestStart and
OnResponseEnd client-side events are
handled to display client-side status messages during the AJAX request.
In order not to allow double charging for the same order (submitting it twice),
form elements on the page are disabled during the AJAX request (the
OnRequestSent
handler) and are enabled once again after the AJAX request returns from the
server (the
OnResponseReceived handler).
The example simulates the order processing on the server with a
Thread.Sleep(2000)
method call.