Skip to content

DevExpress-Examples/asp-net-web-forms-dashboard-save-dashboard-state-to-cookies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dashboard for Web Forms - How to Save a Dashboard State to Cookies

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.

Client

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.

Server

In the ASPxDashboard.SetInitialDashboardState event handler, the HttpRequest.Cookies property gets a collection of cookies sent by the client. The dashboard state is loaded from the cookies and applied to e.InitialState property to set the initial state of the loaded dashboard.

Files to Review

Documentation

More Examples