Skip to main content

Load a Dashboard in ASP.NET Web Forms

  • 2 minutes to read

Load a Dashboard on the Server

Load a Single Dashboard

You can load a single dashboard to your Web Dashboard application.

ASPxDashboard.DashboardXmlPath
Gets or sets the path to the XML definition of a dashboard to be loaded to ASPxDashboard.
ASPxDashboard.OpenDashboard
Loads a dashboard from a string containing a dashboard XML definition.
ASPxDashboard.DashboardType
Gets or sets a dashboard created at design time within Visual Studio. This property is in effect only when ASPxDashboard acts as Viewer.

However, users cannot save changes in a dashboard and create new dashboards if you use this approach. To allow users to do this, create dashboard storage.

Load a Dashboard from Dashboard Storage

Dashboard storage is a location of dashboards you use in your Web Dashboard application. Users can save new dashboards to this storage and open existing dashboards. You can use the following API to manage dashboards in dashboard storage:

ASPxDashboard.DashboardStorageFolder
Gets or sets the path to a folder used to keep dashboards.
ASPxDashboard.LoadDefaultDashboard
Gets or sets whether the default dashboard should be loaded from the dashboard storage.
ASPxDashboard.InitialDashboardId
Gets or sets the identifier of the dashboard to be loaded to ASPxDashboard.

The DashboardInMemoryStorage and DashboardFileStorage classes implement the IDashboardStorage interface. Cast a corresponding object to IDashboardStorage and use IDashboardStorage.GetAvailableDashboardsInfo to obtain available dashboard identifiers.

You can also use the following events to modify dashboards in dashboard storage:

Load a Dashboard on the Client

DashboardControl.loadDashboard
Use this method to load a dashboard with the specified identifier from the dashboard storage.
DashboardControl.unloadDashboard
Call this method to close the displayed dashboard.
DashboardControlOptions.initialDashboardId
Use this property to specify the identifier of the dashboard to be loaded to the DashboardControl before the control is rendered.

The following code snippet demonstrates how to load a dashboard with the dashboard1 identifier on the client:

dashboardControl.loadDashboard("dashboard1")
    .done(function () { alert("A dashboard is loaded successfully."); })
    .fail(function() { alert("Cannot load a dashboard."); });