State Persistence in ASP.NET Core
22 Apr 20221 minute to read
The Syncfusion ASP.NET Core library supports persisting a control’s state across page refreshes or navigation. To enable this feature, set enablePersistence
property as true to the required control. This will store the control’s state in browser’s localStorage
object on page unload
event.
<ejs-grid id="Grid" enablePersistence="true" allowPaging="true">
<e-grid-pageSettings pageCount="5"></e-grid-pageSettings>
<e-data-manager url='https://services.odata.org/V4/Northwind/Northwind.svc/Products/' adaptor="ODataV4Adaptor" crossdomain="true"></e-data-manager>
<e-grid-columns>
<e-grid-column field="ProductID" headerText="ProductID" textAlign="Right" width="160"></e-grid-column>
<e-grid-column field="ProductName" headerText="Product Name" width="170"></e-grid-column>
<e-grid-column field="UnitPrice" headerText="Unit Price" format="C2" textAlign="Right" width="170"></e-grid-column>
<e-grid-column field="UnitsInStock" headerText="Units in Stock" textAlign="Right" width="170"></e-grid-column>
<e-grid-column field="Discontinued" headerText="Discontinued" width="150" displayAsCheckBox="true" textAlign="Center" type="boolean"></e-grid-column>
</e-grid-columns>
</ejs-grid>
State Persistence Supported controls and Properties
The following table demonstrates the list of Syncfusion ASP.NET Core controls that are supported with state persistence and describes the list of properties stored in the localStorage
.
control Name | Properties |
Grid |
|
Accordion |
|
Tabs |
|
Schedule |
|
Kanban |
|
Chart |
|
Maps |
|
Pivot Table |
|
TreeGrid |
|
Switch |
|
Checkbox |
|
RadioButton |
|
ColorPicker |
|
ListBox |
|
QueryBuilder |
|
In-placeEditor |
|
RichTextEditor |
|
Splitter |
|
Autocomplete |
|
Calendar |
|
ComboBox |
|
DatePicker |
|
DropDownList |
|
MaskedTextBox |
|
NumericTextBox |
|
Textbox |
|
TimePicker |
|
Multiselect |
|
DateTimePicker |
|
DateRangePicker |
|
Uploader |
|
Slider |
|
ListView |
|
TreeView |
|
Dashboard Layout |
|
File Manager |
|
Sidebar |
|
Dropdown Tree |
|