My first chance to know about how amazing of this “App_Offline.htm” was about 3 years ago – knowledge sharing by a super friendly contractor David Burela in my company.  We need to take the website offline for maintenance but don’t want turn off the IIS – This file can help!

When you have this file place in your IIS, the application will stop to processing new incoming request and display “App_Offline.htm” content to users.  When you rename/remove this file from your application directory, the application will start to taking care of new incoming request and everything back to normal.

However this “App.Offline.htm” comes with limitations – You cant reference any image/css in this file which is located under the same website.
For example <img src=”../img/abc.jpb” />  –> this will not works.

Work around:
For CSS, we can embedded it in the “App_Offline.htm”, for example:
<style type=”text/css”>your css here</style>

For image, you this web coder tools to convert your image to base64, for example:
base64

Advertisements