-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Error.aspx.cs
90 lines (84 loc) · 3.58 KB
/
Error.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.IO;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Globalization;
using System.Threading;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using DevExpress.ExpressApp.Web;
using DevExpress.ExpressApp.Web.TestScripts;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Web.SystemModule;
public partial class ErrorPage : System.Web.UI.Page {
protected override void InitializeCulture() {
if (WebApplication.Instance != null)
WebApplication.Instance.InitializeCulture();
}
private void Page_Load(object sender, System.EventArgs e) {
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();
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;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e) {
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
this.PreRender += new EventHandler(ErrorPage_PreRender);
}
private void ErrorPage_PreRender(object sender, EventArgs e) {
RegisterThemeAssemblyController.RegisterThemeResources((Page)sender);
}
#endregion
protected void ReportButton_Click(object sender, EventArgs e) {
ErrorInfo errorInfo = ErrorHandling.GetApplicationError();
if (errorInfo != null) {
ErrorHandling.SendAlertToAdmin(errorInfo.Id, DescriptionTextBox.Text, errorInfo.Exception.Message);
ErrorHandling.ClearApplicationError();
ApologizeMessage.Visible = false;
ReportForm.Visible = false;
Details.Visible = false;
ReportResult.Visible = true;
}
}
}