当在ASP.NET2.0的站点的根目录下添加一个app_offline.htm后,你的站点就可以停止了,所有的对aspx文件的请求都会取消,而且页面会定位在app_offline.htm页面。当你在对应用程序做大规模的升级或对数据库更新的时候这个页面将会为您提供极大的方便。也许很多人都已经看过这个页面了,但是我刚从inrie推荐的Fredrik的blog上看到,从这一点上可以看到ASP.NET2.0的又一项细致入微的工作。
如果大家在ASP.NET2.0方面这样的小Tip,欢迎跟贴:-)
posted on 2005-11-18 09:02
维生素C.NET 阅读(1768)
评论(14) 编辑 收藏 所属分类:
ASP.NET
发表评论
这个功能只要在HttpModule中事件中加入转向就可以了吧?
我有一个:
把app_offline.htm的名称改写成app_online.htm,aspx页面又可以取得了!!
@流浪的狗
虚拟目录是可以的。
@垃圾猪
当用户访问一个web site的时候iis会首先看目录下是否有app_offline.htm这个文件的。这样看来似乎它有更高的优先级。
◎zho
在www.asp.net的论坛上发现了这样一篇贴子:
As it turns out, Visual Studio wrote a zero-byte app_online.htm file into my application’s root directory, and apparently when Visual Studio hung, it didn’t get removed. So the web server merrily refused any requests for pages in the application, even though it didn’t give any indication why. If the app_online.htm had contained HTML content, it would have been displayed. So the moral of the story is: if your web application suddenly starts unexpectedly returning 404 responses, check to see if there’s an app_online.htm file in the application’s directory.
我试着在站点上加入了app_online.htm,但是看起来似乎没有任何作用。不知道您的评论是不是只是一个玩笑。有研究过这个的朋友请comment一下,thanks in advance.
我晕。。。我只是开了个玩笑。其实没有这回事。。-_-!
我还。。还没有实践过。。。。
估计Asp。NET的这位老兄也和我一样是顽皮的人。。。。
sorry!!!!!!!!!!!!!!!!!!!!!
@zho
呵呵,一开始我看就以为是开玩笑呢~结果一搜索还真有,可是比较少,不知道这些page是不是也是just for fun的~
呵呵,zho兄不哦那个那样~~
黑人家网站时直接放个app_offline.htm文件就可以啦
@dali
和我一开始看到这个tip的时候想的一样 ~
牛啊!只要不是App_offline.htm这个文件名就OK,改成App_offline.html也可以!
还真有玩意!