示例#1
0
 private string GetTextUrl(PageSummaryView psv)
 {
     try
     {
         if (new BHLProvider().GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").FileExists(psv.OcrTextLocation))
         {
             return("/Text.aspx?PageId=" + psv.PageID);
         }
         else
         {
             return("");
         }
     }
     catch
     {
         if (DebugUtility.IsDebugMode(this.Context.Request))
         {
             return("error");
         }
         else
         {
             return("");
         }
     }
 }
示例#2
0
        protected void Application_Error(object sender, EventArgs e)
        {
            Exception ex = Server.GetLastError();

            if (!DebugUtility.IsDebugMode(Response, Request))
            {
                try
                {
                    if (ex is HttpException)
                    {
                        HttpException http = (HttpException)ex;
                        if (http.GetHttpCode() == 404)
                        {
                            redirectAndEnd("/PageNotFound.aspx");
                        }
                    }
                    redirectAndEnd("/Error.aspx");
                }
                catch
                {
                    redirectAndEnd("/Error.aspx");
                }
            }
            else
            {
                try
                {
                    Exception ex2 = null;
                    if (ex.InnerException != null)
                    {
                        ex2 = ex.InnerException;
                    }
                    else
                    {
                        ex2 = ex;
                    }

                    Response.Write("<b>Message:</b> " + ex2.Message + "<br /><br />");
                    Response.Write("<b>Stack Trace:</b> " + ex2.StackTrace.Replace("\n", "<br />"));
                    Response.End();
                }
                catch
                {
                    redirectAndEnd("/Error.aspx");
                }
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            projectUpdateFeedLocation = ConfigurationManager.AppSettings["projectUpdatesFeedLocation"];

            Page.Header.Controls.Add(ControlGenerator.GetRssFeedControl(projectUpdateFeedLocation,
                                                                        ConfigurationManager.AppSettings["projectUpdatesRssTitle"]));

            debugMode            = DebugUtility.IsDebugMode(Response, Request);
            debugModeDiv.Visible = debugMode;
            if (debugMode)
            {
                Page.Title = "***DEBUG MODE*** " + Page.Title;
            }

            if (!this.IsPostBack)
            {
                PopulateContributorsList();
                PopulateLanguageList();
                DisplayAlertMessage();
            }

            if (pageType == PageType.Content)
            {
                nowOnlineDiv.Visible = true;
                Stats stats = this.GetStats();
                titlesOnlineCount         = stats.TitleCount;
                titlesOnlineLiteral.Text  = stats.TitleCount.ToString("0,0");
                volumesOnlineLiteral.Text = stats.VolumeCount.ToString("0,0");
                pagesOnlineLiteral.Text   = stats.PageCount.ToString("0,0");
                //protologuesOnlineLiteral.Text = stats.ProtologueCount.ToString("0,0");
                //ControlGenerator.AddScriptControl(Master.Page.Header.Controls, "/Scripts/ResizeContentPanelUtils.js");
                ControlGenerator.AddAttributesAndPreserveExisting(Body, "onload", "ResizeContentPanelHeight('newsDiv', 262);");
                ControlGenerator.AddAttributesAndPreserveExisting(Body, "onresize", "ResizeContentPanelHeight('newsDiv', 262);");
                rssFeed.FeedLocation = projectUpdateFeedLocation;
            }
        }