J
Jonas
Hi!
I have an Application_Error method in global.asax that uses Server.Transfer
to move execution to a custom error page. This works fine when an exception
is thrown in one of the aspx or ascx files. The errorpage.aspx uses
Server.GetLastError() and shows a friendly error page.
But when it happens in global.asax itself, the Server.Transfer does not
work. Do I have to use some kind of special exception handling for exception
in global.asax?
TIA
Jonas
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Redirect to custom errorpage, Transfer must be used to get the
exception in the called page.
Context.Server.Transfer("~/errorpage.aspx")
End Sub
I have an Application_Error method in global.asax that uses Server.Transfer
to move execution to a custom error page. This works fine when an exception
is thrown in one of the aspx or ascx files. The errorpage.aspx uses
Server.GetLastError() and shows a friendly error page.
But when it happens in global.asax itself, the Server.Transfer does not
work. Do I have to use some kind of special exception handling for exception
in global.asax?
TIA
Jonas
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Redirect to custom errorpage, Transfer must be used to get the
exception in the called page.
Context.Server.Transfer("~/errorpage.aspx")
End Sub