J
jobs
I'm forcing an error/exception in one page as follows
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
Dim badthing As New Exception("XXX")
Throw badthing
End Sub
And attempting to set a session variable to that error in the
global.asax file as follows:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError()
Session("LASTERROR") = ex.Message.ToString +
ex.InnerException.Message.ToString + ex.Source.ToString
Session("xx") = "xx"
' Code that runs when an unhandled error occurs
End Sub
in my web.config I also have customerrors turned on and redirecting to
an errorpage.aspx page where I want to read that session variable:
The exception happens and I am taken to my errors page, but no sign of
the session variable. If I debug in VS.NET I notice it never makes it
to that subroutine in the global.asax file.
Am I missing something? Could it be that I have no application name?
Is this an IIS thing maybe?
Thanks for any help or information.
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
Dim badthing As New Exception("XXX")
Throw badthing
End Sub
And attempting to set a session variable to that error in the
global.asax file as follows:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = Server.GetLastError()
Session("LASTERROR") = ex.Message.ToString +
ex.InnerException.Message.ToString + ex.Source.ToString
Session("xx") = "xx"
' Code that runs when an unhandled error occurs
End Sub
in my web.config I also have customerrors turned on and redirecting to
an errorpage.aspx page where I want to read that session variable:
The exception happens and I am taken to my errors page, but no sign of
the session variable. If I debug in VS.NET I notice it never makes it
to that subroutine in the global.asax file.
Am I missing something? Could it be that I have no application name?
Is this an IIS thing maybe?
Thanks for any help or information.