Skip to content

The example shows two approaches on how to handle errors in the ASP.NET MVC Dashboard application

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-mvc-dashboard-handle-errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dashboard for MVC - How to handle errors

The following example demostrates two approaches on how to handle errors in the ASP.NET MVC Dashboard application:

Both projects in this example override the OnException method. You can also handle the ASPxWebControl.CallbackError event to customize error text. See the following example for details about this approach: ASP.NET Web Forms Dashboard - How to handle errors

How to specify custom text for internal Dashboard errors

Files to Review

Description

The dashboard in this project contains invalid data connection. This example shows how to override the OnException method in a custom dashboard controller to specify custom text in the exception. The exception occurs when the controller tries to load data.

  1. Create a custom dashboard controller and override the OnException method. You can specify the displayed text depending on whether the application is in development mode.
  2. Specify the created custom controller's name in the view.
  3. Use the created CustomDashboard controller when you map a dashboard route.

How to throw a custom exception during a server-side processing and display the error in the Dashboard error toast

Files to Review

Description

This example shows how to throw a custom exception when a controller loads a dashboard and display this exception in the dashboard error toast. The example overrides the OnException method.

  • Create a custom dashboard controller and override the OnException method. You can specify the displayed text depending on whether the application is in development mode.
  • Specify the created custom controller's name in the view.
  • Use the created CustomDashboard controller when you map a dashboard route.
  • To throw an exception when the control loads a dashboard, create custom dashboard storage and override the LoadDashboard method.

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)