BT

In Case You Missed It: App_Offline.Htm

| by Jonathan Allen Follow 576 Followers on Jan 08, 2007. Estimated reading time: less than one minute |

From time to time operations may find the need to bring down an entire ASP.NET web site for maintenance. And of course a warning message indicating how long the maintenance will take would be useful. ASP.NET 2.0 makes this easy with the magic file known as App_Offline.htm.

By simply placing a file named App_Offline.htm in a web site's root folder switches the site to maintenance mode. The app-domain is shut down and all incoming requests return an error code with the contents of the App_Offline.htm. Once maintenance is complete and the file is deleted, the next request will restart the app-domain.

In order to prevent Internet Explorer from showing "Friendly Http Errors" instead of your message, developers should ensure the App_Offline.htm is at least 512 bytes long. If you simply don't have that much content, the file can be padded with HTML comments or other hidden text.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT