今天得到一个Tip: 如果网站需要更新,而且时间较长时,可以使用ASP.net 2.0就引入的App_Offline.htm
"App_Offline.htm" feature in ASP.NET 2.0, which provides a super convenient way to bring down an ASP.NET application while you make changes to it (for example: updating a lot of content or making big changes to the site where you want to ensure that no users are accessing the application until all changes are done).
The way app_offline.htm works is that you place this file in the root of the application. When ASP.NET sees it, it will shut-down the app-domain for the application (and not restart it for requests) and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application. When you are done updating the site, just delete the file and it will come back online.
本文介绍了一种方便的方法,在进行大规模更新或更改时使ASP.NET应用程序离线。通过在应用根目录放置一个名为app_offline.htm的文件,可以轻松地将应用置于维护状态,并在完成后简单地删除该文件即可重新上线。
878

被折叠的 条评论
为什么被折叠?



