Building Offline capabilites inside .NET web application

john john 946 Reputation points
2022-04-27T17:59:24.307+00:00

We are building a project management web application using those main technologies:-

  • ASP.NET core MVC
  • SQL Server + Entity framework
  • HTML,CSS & Bootstrap

now the application mainly allows to create project >> create tasks under the projects >> assign Task to users >> and so on..

Now part of the requirement is to have certain areas that should be available offline as follow:-

  • My Tasks dashboard. which shows the Tasks assigned to the login user. so even if the user does not have internet access >> the dashboard should list all the Tasks assigned to the user when the user was last online.
  • Complete a task, by entering some fields and upload images. so even if the user does not have internet access >> the user should be able to click on a Task inside the dashboard >> fill the completion sections >> upload images/files >> click on submit >> the data should stay offline, and get submitted automatically once the user has internet access.

So can we have those offline features available inside our web application ? also some users will be accessing the web application inside their mobile web,, so are mobile browser capable of storing data and attachments and allow them to access the dashboard + edit a task and complete it and submit the change offline ? or we will need to have a mobile application instead?

Thanks

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,201 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,846 Reputation points
    2022-04-27T20:29:42.107+00:00

    offline is supported by PWA (progressive web apps). PWA are written in html/css/javascript. there are three browser features used to support offline mode.

    1) ability to define a manifest, so the browser will cache the files required for the app

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

    2) service worker tasks. this are written in javascript, and can intercept Ajax calls and return a cache result if offline.

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

    3) local / offline storage.

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

    PWAs are often written in react, angular or vue. You can also as suggested use blazer

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

    note: You can turn just your dashboard into a PWA landing page. This is probably the easiest, and would not require converting the app to a SPA. Just be sure to use Ajax rather than post backs to display/update the dashboard. as final step, make links to other pages only active when online.

    2 people found this answer helpful.
    0 comments No comments

  2. Michael Taylor 48,736 Reputation points
    2022-04-27T18:16:58.257+00:00

    It's a web app. In order to run it has to be hosted on a web server. If that web server is not on the network you're running on then it isn't going to work. That's how web apps behave.

    If you need a disconnected app then a web app is not the correct solution. You should instead build a regular (Windows) app that can be run without network access. It can then make API calls to a web server (if available) to retrieve its data.

    0 comments No comments