Completed
Last Updated: 24 Oct 2021 19:53 by ADMIN
Jerdobi
Created on: 19 Oct 2021 19:04
Category: UI for Blazor
Type: Feature Request
0
How to use .NET 5 ProtectedBrowserStorage for saving and restoring Grid state

 

The demos and examples for storing and retrieving GRID state uses the JavaScript localStorage.setItem and localStorage.getItem that work great.  As part of .NET 5 there's a Microsoft equivalent for accessing Local Storage using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage.  I've found the behavior of these demos and examples will not work by simply replacing the JavaScript with .NET equivalents.  My experience is getting Circuit Handler exceptions that make these example not work.  

Although not a requirement since there's a JavaScript solution for local storage, I would like to recommend that since you partner closely with .NET team at Microsoft.  That your GRID development team test and provide examples with the Microsoft .NET 5 out-of-the-box local storage solution and resolve any incompatibilities for developers not wanting to use 1st party local storage solutions embedded within Microsoft Blazor.

 

----
ADMIN EDIT

I made a sample test and things seemed to work for me, so I made a public example, you can find it in this pull request until it gets merged. I'm also attaching it to this post, but for anyone seeing this after a time - the public repository linked above is a better place to look for this in case more updates and information have been added since the time of writing this.

---

3 comments
ADMIN
Marin Bratanov
Posted on: 24 Oct 2021 19:53

Glad to see you moving forward, Gary. I hope you get everything working as you need to!

I also took the liberty of editing the opener post to add the info we have there.

--Marin

Jerdobi
Posted on: 23 Oct 2021 19:15

Marin,

Thanks for adding this example and the location to find sample implementations.

I found in further prototyping that the ProtectedBrowserStorage works perfectly using the the Blazor sample server application as a base; as you've found.  The circuit handler exception was when I was testing the Blazor application running under service fabric framework.  When I get time, I'm going to revisit that failed test as I have to re-code it again and will work directly with the MS.Net team on any identified exceptions.

Thanks,

Gary

ADMIN
Marin Bratanov
Posted on: 23 Oct 2021 14:31

Hi Jerdobi,

I made a sample test and things seemed to work for me, so I made a public example, you can find it in this pull request until it gets merged. I'm also attaching it to this post, but for anyone seeing this after a time - the public repository linked above is a better place to look for this in case more updates and information have been added since the time of writing this.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.