The example shows how to save the current dashboard state (such as master filter or parameter values) to cookies on the client side and restore this state on the server side.
The DashboardControlOptions.onDashboardStateChanged event occurs every time the dashboard state changes. In the event handler, the DashboardControl.getDashboardState method call gets the current dashboard state. The document.cookie property is used to save the dashboard state to cookies every time the state changes.
The DashboardConfigurator.SetDashboardStateService method specifies a service that allows you to manage a dashboard state. In this service, the HttpRequest.Cookies property gets a collection of cookies sent by the client.
- CustomDashboardStateService.cs (VB: CustomDashboardStateService.vb)
- DashboardConfig.cs (VB: DashboardConfig.vb)
- Index.cshtml (VB: Index.vbhtml)
- _rootLayout.cshtml (VB: _rootLayout.vbhtml)
- Script.js
- Dashboard for MVC - How to specify a default dashboard state in code
- Dashboard for ASP.NET Core - How to save a dashboard state to cookies
- Dashboard for Web Forms - How to save a dashboard state to cookies
(you will be redirected to DevExpress.com to submit your response)