Example #1
0
        public static void ProcessPageLoadException(Exception exc, string URL)
        {
            if (ThreadAbortCheck(exc))
            {
                return;
            }
            PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();

            if (!Host.UseCustomErrorMessages)
            {
                throw new PageLoadException(exc.Message, exc);
            }
            else
            {
                PageLoadException lex = new PageLoadException(exc.Message.ToString(), exc);
                CommonLibrary.Services.Log.EventLog.EventLogController objExceptionLog = new CommonLibrary.Services.Log.EventLog.EventLogController();
                objExceptionLog.AddLog(lex);
                if (!String.IsNullOrEmpty(URL))
                {
                    if (URL.IndexOf("error=terminate") != -1)
                    {
                        HttpContext.Current.Response.Clear();
                        HttpContext.Current.Server.Transfer("~/ErrorPage.aspx");
                    }
                    else
                    {
                        HttpContext.Current.Response.Redirect(URL, true);
                    }
                }
            }
        }
Example #2
0
 public static void LogException(PageLoadException exc)
 {
     CommonLibrary.Services.Log.EventLog.EventLogController objExceptionLog = new CommonLibrary.Services.Log.EventLog.EventLogController();
     objExceptionLog.AddLog(exc, CommonLibrary.Services.Log.EventLog.EventLogController.ExceptionLogType.PAGE_LOAD_EXCEPTION);
 }
 public static void LogException(PageLoadException exc)
 {
     CommonLibrary.Services.Log.EventLog.EventLogController objExceptionLog = new CommonLibrary.Services.Log.EventLog.EventLogController();
     objExceptionLog.AddLog(exc, CommonLibrary.Services.Log.EventLog.EventLogController.ExceptionLogType.PAGE_LOAD_EXCEPTION);
 }
Example #4
0
 private static Skin LoadSkin(PageBase Page, string SkinPath)
 {
     Skin ctlSkin = null;
     try
     {
         string SkinSrc = SkinPath;
         if (SkinPath.ToLower().IndexOf(Common.Globals.ApplicationPath) != -1)
         {
             SkinPath = SkinPath.Remove(0, Common.Globals.ApplicationPath.Length);
         }
         ctlSkin = ControlUtilities.LoadControl<Skin>(Page, SkinPath);
         ctlSkin.SkinSrc = SkinSrc;
         ctlSkin.DataBind();
     }
     catch (Exception exc)
     {
         PageLoadException lex = new PageLoadException("Unhandled error loading page.", exc);
         if (TabPermissionController.CanAdminPage())
         {
             Label SkinError = (Label)Page.FindControl("SkinError");
             SkinError.Text = string.Format(Localization.GetString("SkinLoadError", Localization.GlobalResourceFile), SkinPath, Page.Server.HtmlEncode(exc.Message));
             SkinError.Visible = true;
         }
         Exceptions.LogException(lex);
     }
     return ctlSkin;
 }
 public static void ProcessPageLoadException(Exception exc, string URL)
 {
     if (ThreadAbortCheck(exc))
         return;
     PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();
     if (!Host.UseCustomErrorMessages)
     {
         throw new PageLoadException(exc.Message, exc);
     }
     else
     {
         PageLoadException lex = new PageLoadException(exc.Message.ToString(), exc);
         CommonLibrary.Services.Log.EventLog.EventLogController objExceptionLog = new CommonLibrary.Services.Log.EventLog.EventLogController();
         objExceptionLog.AddLog(lex);
         if (!String.IsNullOrEmpty(URL))
         {
             if (URL.IndexOf("error=terminate") != -1)
             {
                 HttpContext.Current.Response.Clear();
                 HttpContext.Current.Server.Transfer("~/ErrorPage.aspx");
             }
             else
             {
                 HttpContext.Current.Response.Redirect(URL, true);
             }
         }
     }
 }