• [转载]404错误页面设置


           //定制错误页Error.html
                //错误页可以避免程序抛异常的时候泄露有可能引发安全问题的可能性,只给用户查看错误页面的机会,5秒钟以后会自动跳转到首页。
                //具体做法如下:
                //    在项目中新建一个错误页:Error.html
                //    在其head部分加入一下一段js代码
                //    <script language="javascript" type="text/javascript">
                //            var i = 5;
                //            var intervalId;
                //            intervalId = setInterval("fun()", 1000);
                //            function fun() {
                //                if (i == 0) {
                //                    window.location.href = "Default.aspx";//错误后需要跳转的页面
                //                    clearInterval(intervalId);/* 避免显示负值,清除yTimer */
                //                }
                //                document.getElementById("mes").innerHTML = i;
                //                i--;
                //            }
                //        </script>
                //HTML代码如下:
                //<h3>出错啦~~~~</h3>
                //        <div id="error">
                //            <img src="images/error.gif" alt="error" />
                //            <p>系统出错啦~~~,请联系管理员!</p>
                //            <p>将在 <span id="mes">5</span> 秒中后 返回首页</p>
                //        </div>
                //3.  配置Web.config文件
                //在<system.web>标签中加入
                //<!-- 出现错误的时候自动定向 -->
                //<customErrors mode="On" defaultRedirect="~/Error.htm"></customErrors>

  • 相关阅读:
    安全加固3-加固
    Centos7 64位 -- glibc-2.29 编译升级方法(已成功)
    Centos7 -- glibc 升级失败、意外删除、故意删除后的处理方法
    系统引导修复,grub2下的各种骚作
    linux 升级 5.0.2内核
    kvm虚拟化二: 字符界面管理及 无人值守安装
    kvm虚拟化一: 图形化的管理方式
    Linux rhel7 无线网络配置
    虚拟化简介
    requests模块使用二
  • 原文地址:https://www.cnblogs.com/LD1018/p/8125555.html
Copyright © 2020-2023  润新知