
Partial Class ErrorPage
    Inherits System.Web.UI.Page

    Protected Sub ErrorPage_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not IsNothing(Server.GetLastError) Then
                Dim er = Server.GetLastError
                Dim Trace As String = ""
                If Not IsNothing(er.InnerException) Then Trace = er.InnerException.StackTrace
                Dim mErrMsg As New DB_ErrorMessage.clsErrorMessage
                If mErrMsg.Insert(Request.Url.PathAndQuery, er.Message.Replace(Chr(34), "&nbsp;").Replace("'", "&nbsp;").Replace(vbCrLf, "<br />"), Trace.Replace(Chr(34), "&nbsp;").Replace("'", "&nbsp;").Replace(vbCrLf, "<br />")) Then
                    BaseFunction.PublicMethod.ShowMessage(Me.Page, "错误提示", "系统发生内部错误！\r\n详细信息已经记录，请登录后查看！", BaseFunction.PublicMethod.WindowIcon.Infomation)
                Else
                    BaseFunction.PublicMethod.ShowMessage(Me.Page, "错误提示", "系统发生内部错误！\r\n详细信息录入失败，请及时修复，否则将无法查看记录！", BaseFunction.PublicMethod.WindowIcon.Errors)
                End If
                Server.ClearError()
            Else
                Dim path As String = Request("path")
                BaseFunction.PublicMethod.ShowMessage(Me.Page, "错误提示", "您查看的页面 " & path & " 不存在请检查链接是否正确！", BaseFunction.PublicMethod.WindowIcon.Errors)
            End If
        End If
    End Sub
End Class
