HOW TO stop any ASP.NET (2.0) processing for a website

A typical case when we need to disable ASP.NET processing is when we have a maintenance activity & visitors to the website should see a notification message no matter which page they try to access.

I learnt about using "app_offline.htm", a new feature in ASP.NET 2.0 to stop any ASP.NET processing for a website without involving IIS from Fritz Onion's Essential ASP.NET Webcast series (Part X).

The trick is to place a file named app_offline.htm in the root directory with a message like "Site down for maintenance".

To re-enable the app, the file can be removed or Excluded from Project.

This technique has a quirk. If you use the app_offline.htm feature, you should make sure you have at least 512 bytes of content within it to make sure that your HTML (instead of IE's friendly status message) shows up to your users.

Comments