Store Data of Your Blazor App in the Local Storage and in the Session Storage

To store local data, today's browsers support a local storage and a session storage. The difference between the two is that the session storage is only available per tab, and the stored data is deleted once you close the tab with the application. The local storage on the other side stores data across sessions. Even when you close the browser and when you re-open it again, the data of the local storage is still there. It will be there as long until you delete it.

So, the difference between the two is how long the data is stored. Beside that, they work exactly the same. Both can store key/value pairs, and those key/value pairs are stored in plain text.

In this blog post, let's look at how to use the local storage and the session storage in your Blazor App.


Build applications for Windows 8

Yesterday morning Microsoft launched Windows 8 at the BUILD-conference in Anaheim. Windows 8 has a completely new tile- and touch-based UI with the Metro-Style we already know from Windows Phone 7. For us as Developers the big question was how to develop applications for Windows 8. Microsoft already said something about HTML5 and JavaScript in another preview-video that appeared on youtube before. Yesterday they mentioned more about that topic. First of all: All applications built for Windows 7 will still run on Windows 8. Ok, know let’s look at the platform and the tools we’re using today with Windows. plattformToolsToday Today we’ve classical Applications running on the Desktop built with .NET, Silverlight or just a Win32-App. There are also Web-Applications built with HTML and Javascript running in Internet Explorer or another browser. The problem Microsoft mentioned here is that these three things don’t work together very well. Therefore Microsoft reimagined the Windows-8-platform. You can use any language you wan’t to build the metro-style applications like the picture below shows. plattformToolsWin8 As you can see in the picture above, Microsoft has also reimagined the Windows APIs. They know are calling the Windows APIs the Windows Runtime APIs, or short, the WinRT APIs. WinRT provides over 1800 objects for us developers to use. These 1800 objects are in four blocks:
  • Application Model
  • Communication & Data
  • Graphics & Media
  • Devices & Printing
It’s important to mention that all these blocks are natively built into Windows. It’s not a layer on top of windows, it is windows. The APIs are reflected in C/C++, C# and VB and also in Javascript. So you can use any language you want. Use C/C++/C# or VB and built your view in XAML, or use JavaScript and build your view in HTML/CSS There’s Version 11 of Visual Studio that let’s you create the same Metro-style applications in the different languages. visualStudio2011NewProject Expression Blend 5 will beside XAML also support HTML. So there’s a great tooling for all view-languages. Applications can be published in an App Store called the Windows Store. Same principle as Apple has with their App Store in Mac OS X Lion. Visual Studio 2011 therefore contains a new store-menu where you can upload a package directly from visual studio. Go and grab a Windows 8 Preview with all the tools installed to get started developing Windows 8 apps here: Ok, the big question after knowing all of that is what happens to .NET, Silverlight, WPF in Windows 8? XAML stays, but Silverlight and WPF are just on the side, aren’t they? Let's download the preview and discuss.