Ejemplo n.º 1
0
    private void Page_Load(object sender, System.EventArgs e)
    {
        if (TestScriptsManager.EasyTestEnabled)
        {
            TestScriptsManager testScriptsManager = new TestScriptsManager(Page);
            testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "FormCaption", TestControlType.Field, "FormCaption");
            testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "RequestUrl", TestControlType.Field, "RequestUrl");
            testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "DescriptionTextBox", TestControlType.Field, "Description");
            testScriptsManager.RegisterControl(JSDefaultTestControl.ClassName, "ReportButton", TestControlType.Action, "Report");
            testScriptsManager.AllControlRegistered();
            ClientScript.RegisterStartupScript(GetType(), "EasyTest", testScriptsManager.GetScript(), true);
        }
        if (WebApplication.Instance != null)
        {
            ApplicationTitle.Text = WebApplication.Instance.Title;
        }
        else
        {
            ApplicationTitle.Text = "No application";
        }
        Header.Title = "Application Error - " + ApplicationTitle.Text;

        ErrorInfo errorInfo = ErrorHandling.GetApplicationError();

        if (errorInfo != null)
        {
            RequestUrl.NavigateUrl  = errorInfo.Url;
            RequestUrl.Text         = errorInfo.Url;
            RequestUrl2.NavigateUrl = errorInfo.Url;
            RequestUrl2.Text        = errorInfo.Url;
            if (!string.IsNullOrEmpty(errorInfo.UrlReferrer))
            {
                HyperLinkReturn.NavigateUrl = errorInfo.UrlReferrer;
            }
            else
            {
                LiteralReturn.Visible   = false;
                HyperLinkReturn.Visible = false;
            }
            if (ErrorHandling.CanShowDetailedInformation)
            {
                DetailsText.Text = errorInfo.GetTextualPresentation(true);
            }
            else
            {
                Details.Visible = false;
            }
            ReportResult.Visible = false;
            ReportForm.Visible   = ErrorHandling.CanSendAlertToAdmin;
        }
        else
        {
            ErrorPanel.Visible = false;
        }
    }
Ejemplo n.º 2
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (TestScriptsManager.EasyTestEnabled)
            {
                var testScriptsManager = new TestScriptsManager(Page);
                testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "FormCaption", TestControlType.Field,
                                                   "FormCaption");
                testScriptsManager.RegisterControl(JSLabelTestControl.ClassName, "DescriptionTextBox",
                                                   TestControlType.Field, "Description");
                testScriptsManager.RegisterControl(JSDefaultTestControl.ClassName, "ReportButton",
                                                   TestControlType.Action, "Report");
                testScriptsManager.AllControlRegistered();
                ClientScript.RegisterStartupScript(GetType(), "EasyTest", testScriptsManager.GetScript(), true);
            }
            if (WebApplication.Instance != null)
            {
                ApplicationTitle.Text = WebApplication.Instance.Title;
            }
            else
            {
                ApplicationTitle.Text = "No application";
            }
            Header.Title = "Application Error - " + ApplicationTitle.Text;

            var errorInfo = ErrorHandling.GetApplicationError();

            if (errorInfo != null)
            {
                if (ErrorHandling.CanShowDetailedInformation)
                {
                    DetailsText.Text = errorInfo.GetTextualPresentation(true);
                }
                else
                {
                    Details.Visible = false;
                }
                ReportForm.Visible = ErrorHandling.CanSendAlertToAdmin;
            }
            else
            {
                ErrorPanel.Visible = false;
            }
        }