`
j2ee_chenwei
  • 浏览: 40655 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
最近访客 更多访客>>
社区版块
存档分类
最新评论

app_offline.htm 应用程序离线信息

阅读更多
ASP.net 2.0 有一个新特性,就是支持应用程序离线信息。

什么是离线信息呢?以前我们在更新应用程序,导至asp.net应用程序重启,应用程序的用户通常会显示不友好的错误信息,或者IE一直显示加载状态。

ASP.net 2.0支持您在应用程序根目录下放置一个app_offline.htm文件,用户请求时,系统会检查是否有这个文件存在,如果有,系统会将app_offline.htm文件的内容直接返回给用户。

app_offline.htm的内容可以更改成任何您需要的内容,但是要注意,文件不能太小,因为大部分用户的IE设置了“显示友好的Http错误信息”,如果app_offline.htm小于512字节,此设置将会失效。

另外注意一下地址栏,offline信息显示时,地址栏依然显示的时请求的地址

以上我在iss6下测试成功

app_offline.html文件内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title>应用程序脱机</title>
     <style  type="text/css">

    div {
        background-color:#ffffcc;
        padding-top:10px;
        padding-bottom:10px;
        padding-left:10px;
        padding-right:10px;   
        border-style:solid;
        border-color:Black;
        border-width:1px;
    }

    </style>
</head>
<body>
     <div>
        This application is currently offline.  To enable the application, remove the
        app_offline.htm file from the application root directory.
    </div>
</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics