Skip to main content
All docs
V24.1

Dashboard Controller

  • 2 minutes to read

A dashboard controller is an MVC Controller descendant. The dashboard controller handles incoming client requests and map them to actions on the server.

Add a Dashboard Controller

Depending on your platform, add a dashboard controller to your application as follows.

ASP.NET Core

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:

ASP.NET MVC

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 {
    }
}

Add the newly created controller’s name (without the Controller postfix) to the following places:

Restrict Access to the Server for Clients

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:

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.

View Example: ASP.NET Core View Example: ASP.NET MVC