dashboard-404308-web-dashboard-concepts-and-terminology-dashboard-controller.md
A dashboard controller is an MVC Controller descendant. The dashboard controller handles incoming client requests and map them to actions on the server.
Depending on your platform, add a dashboard controller to your application as follows.
Add a new empty DefaultDashboard controller and inherit the DashboardController class:
using DevExpress.DashboardAspNetCore;
using DevExpress.DashboardWeb;
using Microsoft.AspNetCore.DataProtection;
namespace WebDashboardAspNetCore.Controllers {
public class DefaultDashboardController : DashboardController {
public DefaultDashboardController(DashboardConfigurator configurator, IDataProtectionProvider? dataProtectionProvider = null)
: base(configurator, dataProtectionProvider) {
}
}
}
Add the newly created controller’s name (without the Controller postfix) to the following places:
Add a new empty DefaultDashboard controller to the project’s Controllers folder and inherit the DashboardController class:
using DevExpress.DashboardWeb.Mvc;
namespace MvcCustomController {
public class DefaultDashboardController : DashboardController {
}
}
Imports DevExpress.DashboardWeb.Mvc
Namespace MvcCustomController
Public Class DefaultDashboardController
Inherits DashboardController
End Class
End Namespace
Add the newly created controller’s name (without the Controller postfix) to the following places:
Initially, the server works at the ClientTrustLevel.Full trust level. The working mode does not influence the server settings. Verify the trust level and specify which actions a client can initiate on the server.
You can do one of the following to prevent inadvertent or unauthorized dashboard modifications and protect dashboards stored on a server:
DashboardController.Restricted mode affects the Web Dashboard in the following manner:
Only dashboards stored in dashboard storage can be processed on the client. Designer mode does not work.
Calling the IEditableDashboardStorage.AddDashboard and IDashboardStorage.SaveDashboard methods leads to an exception.
Information about data sources contained in a dashboard xml definition is not passed to the client when you request a dashboard XML file.
The following examples show how to create and use a restricted dashboard controller. In these examples, the custom controller name is DefaultDashboard.