/
Manager_ErrorCatch.ascx.cs
48 lines (42 loc) · 1.37 KB
/
Manager_ErrorCatch.ascx.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Services.Exceptions;
namespace DNNGo.Modules.DNNGalleryPro
{
public partial class Manager_ErrorCatch : BaseModule
{
protected void Page_Load(object sender, EventArgs e)
{
//加载脚本
if (!IsPostBack)
{
//接受报错信息
if (HttpContext.Current.Session["Exception"] != null)
{
Exception exc = HttpContext.Current.Session["Exception"] as Exception;
HttpContext.Current.Session.Remove("Exception");
liException.Text = exc.Message;
DotNetNuke.Services.Exceptions.Exceptions.LogException(new ModuleLoadException(exc.Message.ToString(), exc, ModuleConfiguration));
}
}
}
/// <summary>
/// 返回
/// </summary>
protected void cmdReturn_Click(object sender, EventArgs e)
{
try
{
String ReturnUrl = WebHelper.GetStringParam(Request, "ReturnUrl", "");
Response.Redirect(ReturnUrl, false);
}
catch (Exception exc)
{
}
}
}
}