You can do one of the following to prevent inadvertent or unauthorized dashboard modifications and protect dashboards stored on a server:
- Handle the DashboardConfigurator.VerifyClientTrustLevel event and set e.ClientTrustLevel to
Restricted
mode. - Derive a custom dashboard controller from RestrictedDashboardController instead of DashboardController.
The example shows how to create a restricted dashboard controller for the Web Dashboard in an ASP.NET MVC application.
Inherit the DashboardController class to create a custom dashboard controller. Add its name (without a Controller
prefix) to the following places:
- The RouteCollectionExtension.MapDashboardRoute method when you configure routing;
- The DashboardExtensionSettings.ControllerName property when you configure a control on the page.
In this example, the custom controller name is DefaultDashboard
.
- DashboardConfig.cs (VB: DashboardConfig.vb)
- DefaultDashboardController.cs (VB: DefaultDashboardController.vb)
- Index.cshtml (VB: Index.vbhtml)
- Dashboard for ASP.NET Core - How to create a restricted dashboard controller
- Dashboard for MVC - How to use separate server-side settings for different views
- Dashboard for MVC - How to implement multi-tenant Dashboard architecture
- Dashboard for MVC - How to load different data based on the current user
(you will be redirected to DevExpress.com to submit your response)