2

I am developing an ASP.NET website. The users can open up the web page and work with data when they are online. But I want to make them able to work when they are offline and submit their changes later when they are online again. The offline application must be very simple to run and I don't want to develop a separate windows application for this purpose.

So I want to build an executable that when starts, first starts up a local IIS and then opens the startup page of my website (which is locally available) in the user's browser.

And of course it would be great if this executable can be installed on the user's system along with my website files, IIS and SQL Server Express all in one package.

2
  • How would you sync between local IIS and your website? You'll end up having more work getting this solution to run than just clone your ASP.NET site to a Windows app. Commented May 16, 2012 at 8:45
  • Hi Filburt, The sync problem is not that serious in my website since very few number of users work with the data and the chance of conflicting edits is very low, in which case I can show a special form for user decision upon submit. Commented May 16, 2012 at 9:30

2 Answers 2

1

OK I re-read your question and see that you will have local IIS and local Database installed on all client systems.

So then the solution is very simple.

The Applicaiton (main form)

  1. Create a windows forms application.
  2. Put a WebBrowser control and a StatusStrip control on the form.
  3. Add two string resources named say LocalStartUrl and OnlineStartUrl, which holds the addresses of your local and online website home/startup pages.
  4. On Form_Load, check for online internet connectivity and accordingly launch either LocalStartUrl or OnlineStartUrl in the webbrowser control. You can show messagebox and use the StatusBar to inform the user of the same.

The sync module:

The database sync module runs in the timer/separate thread and synchronizes your local database with online database in the background. It sends any unsaved changes to the server and downloads any missing data from the server to local database. You would need to control the speed of this module so that user doesn't face difficulty browsing other websites or using the application smoothly etc. It should be slow and steady and send/request only small chunks of data at a time.

When in offline mode, it just periodically checks for online connectivity at regular intervals. As soon as an internet connectivity can be found, the user is informed. If they permit, it switches over to online mode. Otherwise the user continues to work offline until the application is closed and launched again.

In online mode, the sync module syncs data to & from the online database. This doesn't affect the user because they are not connected to this database. Instead they are connected to the online website and database.

It will take efforts to streamline this approach, but ultimately it is achievable easily.

Sign up to request clarification or add additional context in comments.

3 Comments

Just forgot to mention that the preferred way for the database sync module would be via ftp or webservice rather than http. But either ways would work. :)
Thanks again Pradeep, but I guess I haven't asked my question well. I don't want to create a windows forms application with a WebBrowser control. I would like to give my customers an installable offline version of my website that they can work with just like the online version in their browser. And the sync matter is not my question (though I liked your instructions)
OK I see. You are talking about an installer for installing the website and database. I'm not good at installers, but you can create a .NET project of "Setup" type. This project will help you create the installer with the bits you need. :)
0

This won't be just a single task. It would be a series of task working together in sync.

Your windows application does the following:

  • Write the offline changes to a disk file/database etc.
  • Periodically check the online availability of your website/ftp site.
  • Whenever the website is found to be available, and there are some cached changes, submit the file to the website/ftp site.

Your server does the following:

  • Whenever a file is recieved, check for its validity and integrity. If found correct, put it in a specific folder.
  • A service on your server watches the folder and as soon as any file is found there, processes the file(s)
  • The service moves the file to another folder (backup) after processing.

3 Comments

Hi Pradeep, That's a very nice idea for the synchronization issue but my question is about building the offline executable of my website. Thanks anyway
are you sure all client system will be capable (and will have) local copy of your website and database installed?
No, but I'd like to hand over to my (grandma) customers an easy-to-install package that they would just install and use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.