zoukankan      html  css  js  c++  java
  • [转载]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>

  • 相关阅读:
    放苹果
    滑雪-递归
    模数之和
    n个数的最小公倍数
    webapi跨域实现(CROS、JSONP)
    HttpRequestMessage扩展方法
    webapi基于单请求封装多请求的设计【转】
    webapi中获取HttpContext
    webapi序列化控制
    webapi简介及参数绑定
  • 原文地址:https://www.cnblogs.com/LD1018/p/8125555.html
Copyright © 2011-2022 走看看