Build Standalone ASP.Net Web Application

I am developing an asp.net web application (3.5) and wondered if you knew how I could do this so that there would be some kind of standalone function.

This is necessary because people will be able to "install" the web application on their device (using the "Add to Home Screen" function on the iPhone, for example), and then use the application when they are offline; usage will be limited only (at this point there will be no need for server calls).

Can this be done using the .aspx page?

Added parameter Edit-.manifest:

CACHE MANIFEST index.aspx /logo.png /main.css /main.js 

Change No. 2 -

We work offline; It works when in safari, but we don’t want it in safari, we want it to be a standalone application. When we try to run it like this, we get the message "can not connect to server error". Is this possible with the .aspx page?

Change No. 3 -

We have this for working using an .html page, but not yet with .aspx

Change No. 4 -

Now it works, although we are not sure why! We added index.aspx to the "network" section of cache.manifest last week (which did not work last week!), Which may have helped, but as soon as I know for sure that I will update what actually happened!

Thank you all for your help!

+6
source share
4 answers

For HTML5 offline applications with ASP.NET see link and link.

There are several alternatives for autonomous functions:

01 . If you need to store small amounts of data in a standalone application, and security is not a big concern, you can use the HTML5 web storage ( link , link , link ,, and see CanIUse to find out the version of browser support).

The main disadvantages are the lack of security based on the key value (without complex structures), and there is a large storage size limit (5 MB for most browsers).


02 . If you need more data, you can look at the IndexDB link (, link , and CanIUse ) or Web Sql ( link , link , link and CanIUse for browser support).

The main disadvantages of web SQL are that Firefox is not supported by IE. In addition, it is deprecated by the W3C.

IndexDB is nice ( link ), but ios doesn't seem to support it anyway (see canIUse).

For approaches 1 and 2, you can create a responsive design or a dedicated mobile website in your ASP.NET application ( link ).


03 - (great flexibility requires a lot of effort) Implementing a web service in an ASP.NET application and a mobile application using the concepts of "Randomly connected applications" (more: link )

  • ASP.NET Web Application => For a web application, expose a web service with services related to stand-alone functionality.

  • Mobile application => Implement your own mobile application (for example, create an application for Android and iphone) with a database for the application. Then you create a standalone function in a mobile application that will use its own database to read and write (locally) data that should be available offline.

Then you implement the silent synchronization mechanism in a mobile application that relies on the Internet (for example, a repeating stream) that will look for updates by accessing the ASP.NET application through a web service. This synchronization mechanism will send data that has been saved locally and restore data from the web service, which may be useful for offline work.


Hope this helps.

+12
source

The way to do this - although I didn't have the opportunity to do this - will use one of the new HTML5 features: a cache manifest.

You can read a very good example of this here: http://www.html5rocks.com/en/tutorials/appcache/beginner/

+1
source

Yes, what can be done with ASP.NET, because ASP.NET displays the HTML page in the client browser, and the stand-alone function is pure JavaScript / Html functionality. Here 's an article by Stephen Walter showing one way to do this.

0
source

Yes. This can be done, as others have said, using the Cache manifest.

What I propose to do is create a handler to generate a cache manifest , which can be dynamic.

One thing that is painful for the cache manifest file is that if this file does not change, updates will not be performed. Here is the handler. Add a C # comment section as a comment character and update the timestamp after that

#2013-08-08 1:53:36 PM 'This is your comment section

If this is generated by the handler, you can save it to the database when each user page can be refreshed (this makes it dynamic, still caching it)

One important thing to keep in mind when using the cache manifest:

Files that are cached must match the exact query string for access. On some devices, this is case sensitive, and any query strings that exist on one MUST exist exactly the same as on the other, so you need this foresight when creating cache manifest files.

0
source

Source: https://habr.com/ru/post/951212/


All Articles