ASP.NET WebForms - Introducing offline capabilities

Brydon Johnstone 21 Reputation points
2021-09-08T14:01:57.197+00:00

I currently have a web forms page that users use to control data sitting in an Azure SQL database.

With each postback, a grid is drawn and populated with data pulled from said database.

The client has requested that offline functionality needs to be introduced. This means that the application needs to be able to switch to another grid with a whole new set of data, while offline.

What my question is, is:
What would be the best way to accomplish this? I've begun using IndexedDb to bridge the connection gap somewhat but this is not enough.
What is the best solution here? I am open to new technologies such as Blazor etc.

Azure SQL Database
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
969 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
548 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 35,641 Reputation points
    2021-09-08T16:34:39.123+00:00

    normally for offline, you use a service worker. see:

    https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API

    service workers also have access to indexDB (which in current browsers is implemented with SQLite)

    https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

    these two technologies are generally combined to create a PWA.

    https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps

    note: if you are interested in Blazor, only Blazor WSAM can work offline. You can build a PWA with Blazor, but the service worker must still be written in javascript. A WASM can not directly access indexDB (same as it can not access dom, ajax or fileapi) but can call host. Blazor does this by an interop library.


  2. KalyanChanumolu-MSFT 8,256 Reputation points Microsoft Employee
    2021-09-09T02:22:35.857+00:00

    @Brydon Johnstone Blazor WASM is an excellent choice for building web applications with offline capabilities.
    Please go through our detailed documentation here and let us know if you have any further questions.

    Blazored LocalStorage is a library that provides access to the browser's local storage APIs for Blazor applications.

    ----------

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.