The following example demostrates two approaches on how to handle errors in the ASP.NET Web Forms Dashboard application:
- How to specify custom text for internal Dashboard errors
- How to throw a custom exception during a server-side processing and display the error in the Dashboard error toast
The dashboard in this project contains invalid data connection. This example shows how to use the ASPxWebControl.CallbackError event to override the default text in the exception. The exception occurs when a control tries to load data.
Handle the ASPxWebControl.CallbackError
event and specify the callback error message. You can specify the displayed text depending on whether the application is in development mode.
How to throw a custom exception during a server-side processing and display the error in the Dashboard error toast
This example shows how to throw a custom exception when a control loads a dashboard. This example uses the ASPxWebControl.CallbackError event. The ASPxWebControl.SetCallbackErrorMessage method specifies the message text to be displayed for remote clients when a DevExpress control callback error has occurred.
- Handle the
ASPxWebControl.CallbackError
event and specify the callback error message. The displayed text depends on whether the application is in development mode. - To throw an exception when the control loads a dashboard, create custom dashboard storage and override the
LoadDashboard
method.
(you will be redirected to DevExpress.com to submit your response)