예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            PortalSettings portalSettings = PortalController.GetCurrentPortalSettings();

            if (portalSettings != null && !String.IsNullOrEmpty(portalSettings.LogoFile))
            {
                IFileInfo fileInfo = FileManager.Instance.GetFile(portalSettings.PortalId, portalSettings.LogoFile);
                if (fileInfo != null)
                {
                    headerImage.ImageUrl = FileManager.Instance.GetUrl(fileInfo);
                }
            }
            headerImage.Visible = !string.IsNullOrEmpty(headerImage.ImageUrl);

            string         strLocalizedMessage = Null.NullString;
            PortalSecurity objSecurity         = new PortalSecurity();
            string         status = objSecurity.InputFilter(Request.QueryString["status"],
                                                            PortalSecurity.FilterFlag.NoScripting |
                                                            PortalSecurity.FilterFlag.NoMarkup);

            if (!string.IsNullOrEmpty(status))
            {
                ManageError(status);
            }
            else
            {
                //get the last server error
                Exception exc = Server.GetLastError();
                try
                {
                    if (Request.Url.LocalPath.ToLower().EndsWith("installwizard.aspx"))
                    {
                        ErrorPlaceHolder.Controls.Add(new LiteralControl(HttpUtility.HtmlEncode(exc.ToString())));
                    }
                    else
                    {
                        PageLoadException lex = new PageLoadException(exc.Message, exc);
                        //process this error using the Exception Management Application Block
                        Exceptions.LogException(lex);
                        //add to a placeholder and place on page
                        strLocalizedMessage = Localization.Localization.GetString("Error.Text",
                                                                                  Localization.Localization.
                                                                                  GlobalResourceFile);
                        ErrorPlaceHolder.Controls.Add(
                            new ErrorContainer(portalSettings, strLocalizedMessage, lex).Container);
                    }
                } catch
                {
                    //No exception was found...you shouldn't end up here
                    //unless you go to this aspx page URL directly
                    strLocalizedMessage = Localization.Localization.GetString("UnhandledError.Text",
                                                                              Localization.Localization.
                                                                              GlobalResourceFile);
                    ErrorPlaceHolder.Controls.Add(new LiteralControl(strLocalizedMessage));
                }
            }
            strLocalizedMessage = Localization.Localization.GetString("Return.Text",
                                                                      Localization.Localization.GlobalResourceFile);

            hypReturn.Text = "<img src=\"" + Globals.ApplicationPath + "/images/lt.gif\" border=\"0\" /> " +
                             strLocalizedMessage;
        }