跳转去错误页面 - RedirectError

2017-02-26 20:38:39  访问(1437) 赞(0) 踩(0)


        /// <summary>
        /// 跳转去错误页面 - RedirectAdminError +
        /// </summary>
        /// <param name="msg"></param>
        public void RedirectAdminError(string msg)
        {
            if (HttpContext.Current == null)
            {
                throw new Exception
                    (
                        "HttpContext.Current == null"
                    );
            }

            if (msg == null)
                msg = "系统错误";

            HttpContext.Current.Response.Redirect
                (
                    WebBasicData.instance.phyPath + "/WebForms/AdmFineUI/Error.aspx?msg=" + HttpContext.Current.Server.UrlEncode(msg),
                    false
                );
        }


        /// <summary>
        /// 跳转去错误页面 - RedirectError +
        /// </summary>
        /// <param name="msg"></param>
        public void RedirectError(string msg)
        {
            if (HttpContext.Current == null)
            {
                throw new Exception
                    (
                        "HttpContext.Current == null"
                    );
            }

            if (msg == null)
                msg = "系统错误";

            HttpContext.Current.Response.Redirect
                (
                    WebBasicData.instance.phyPath + "/Error.aspx?msg=" + HttpContext.Current.Server.UrlEncode(msg),
                    false
                );
        }

        /// <summary>
        /// 跳转去错误页面 - RedirectError +
        /// </summary>
        /// <param name="msg"></param>
        public void RedirectError(HttpContext context,string msg)
        {
            if (context == null)
            {
                throw new Exception
                    (
                        "HttpContext context == null"
                    );
            }

            if (msg == null)
                msg = "系统错误";

            context.Response.Redirect
                (
                    WebBasicData.instance.phyPath + "/Error.aspx?msg=" + HttpContext.Current.Server.UrlEncode(msg),
                    false
                );
        }


标签:跳转去错误页面 - RedirectError 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)