dashboard-devexpress-dot-dashboardaspnetcore-52fb5126.md
Contains methods that allow you to configure the Web Dashboard’s back-end.
Namespace : DevExpress.DashboardAspNetCore
Assembly : DevExpress.Dashboard.v25.2.AspNetCore.dll
NuGet Package : DevExpress.AspNetCore.Dashboard
public class DashboardBackendOptionsBuilder
Public Class DashboardBackendOptionsBuilder
The following members return DashboardBackendOptionsBuilder objects:
The Web Dashboard allows you to separate the client and server. This means you can:
The table below illustrates correlations between server and client. The row headers display platforms you can use as a server, the column headers show available client counterparts.
|
Server \ Client
|
ASP.NET Web Forms
|
ASP.NET MVC
|
ASP.NET Core
|
HTML JS
| | --- | --- | --- | --- | --- | |
ASP.NET Web Forms (UseDashboardConfigurator = false)
|
|
|
|
| |
ASP.NET Web Forms (UseDashboardConfigurator = true)
|
|
|
|
| |
ASP.NET MVC
|
|
|
|
| |
ASP.NET Core
|
|
|
|
|
Use the DashboardBuilder.BackendOptions method to configure a server from the client application:
|
Platform
|
Member
| | --- | --- | |
ASP.NET Web Forms
|
| |
ASP.NET MVC
|
DashboardExtensionSettings.BackendOptions
| |
ASP.NET Core
| | |
HTML JS
|
DashboardControlOptions.endpoint / FetchRemoteServiceOptions.headers
|
The following code snippets show how to configure the client: to set the server’s URL and pass a custom Authorization header. Note that the server’s URL should consist of a base URL (where the Web Dashboard’s server side is hosted) and a route prefix (a value that is set in the MVC / .NET Core MapDashboardRoute properties).
For MVC or ASP.NET Core back-end, the url is a controller’s address:
DashboardControl.BackendOptions.Uri = "{baseURL}/api/dashboard";
DashboardControl.BackendOptions.RequestHttpHeaders.Add("Authorization", "AuthToken123");
DashboardControl.BackendOptions.Uri = "{baseURL}/api/dashboard";
DashboardControl.BackendOptions.RequestHttpHeaders.Add("Authorization", "AuthToken123");
@(Html.DevExpress().Dashboard("dashboardControl1")
.BackendOptions(options => options.Uri("{baseURL}/api/dashboard").RequestHttpHeaders(headers => { headers.Add("Authorization", "AuthToken123"); }))
)
<script>
window.onload = function () {
var dashboardControl = new DevExpress.Dashboard.DashboardControl(document.getElementById("web-dashboard"), {
endpoint: "{baseURL}/api/dashboard",
fetchRemoteService: {
headers: {
'Authorization': 'AuthToken123'
}
}
});
}
</script>
Object DashboardBackendOptionsBuilder
See Also