ASPxClientGlobalEvents.CallbackError Event
Fires on the client if any server error occurs during server-side processing of a callback sent by any of DevExpress web controls.
Declaration
CallbackError: ASPxClientEvent<ASPxClientGlobalCallbackErrorEventHandler<ASPxClientGlobalEvents>>
Event Data
The CallbackError event's data class is ASPxClientGlobalCallbackErrorEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
control | Gets an object that initiated a callback. |
handled | Gets or sets whether the event is handled and the default error handling actions are not required. Inherited from ASPxClientCallbackErrorEventArgs. |
message | Gets the error message that describes the server error that occurred. Inherited from ASPxClientCallbackErrorEventArgs. |
Remarks
The CallbackError event enables you to centrally respond to server errors that might occur as a result of server-side callback processing initiated by any DevExpress web control. You can handle this event to perform specific client-side actions, such as displaying explanatory text or an image related to the error, for example.
Typically, a server error that occurs during server-side processing of a callback leads to the web application hanging, because, in this case, no proper response is generated for a control that initiated the callback. However, AJAX-enabled web controls from the DevExpress product line are able to automatically catch server errors occurring within handlers of their server-side events, and to pass the related error information to the client for further processing. On the client side, the error can be processed either on the level of an individual control (by using the control’s CallbackError event) or centrally - by handling the ASPxClientGlobalEvents object’s CallbackError event.
Example
<dx:ASPxGlobalEvents ID="ASPxGlobalEvents1" runat="server">
<ClientSideEvents
BeginCallback="function(s, e) {
alert('BeginCallback ' + e.control.name);
}" CallbackError="function(s, e) {
alert('CallbackError ' + e.control.name);
}" EndCallback="function(s, e) {
alert('EndCallback ' + e.control.name);
}" />
</dx:ASPxGlobalEvents>