App_Offline.htm and Ajax.NET Professional

Michael Schwarz on Tuesday, April 11, 2006

I read the nice article about the App_Offline.htm on Scotts [1] blog [2]. If you are using Ajax.NET Professional [3] you can simply check in the callback function if there is any error. While the App_Offline.htm is placed in your web application you will get the res.error.status = 404. This indicates that the file you are trying to download (the request to your Ajax.NET method) could not be found. It would be nice to get a more AJAX enabled friendly error message while the web application is offline. In my local version I have added <!-- App_Offline.htm --> to my App_Offline.htm source which indicates the Ajax.NET Professional library to throw a different error event than http status 404. It would be nice if Microsoft would add such information to a http header like this:

HTTP/1.1 404 Not FoundServer: Microsoft-IIS/5.1
Date: Tue, 11 Apr 2006 09:33:10 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
X-AspNet-Status: Offline
Cache-Control: private
Content-Type: text/html
Content-Length: 3648

With this additional (or maybe optional) http header it would be easier to enable offline working for AJAX enabled web applications.