Link to home
Create AccountLog in
Avatar of saitwebdev

asked on

Application Error logging of child processes

I'm trying to log errors using the Application_Error event in Global.asax using Server.GetLastError.

It works fine except one case: if page A uses a server.transfer to page B, and an error happens on page B.  Instead of a useful message like this:

e:\websites\asbhu\foo.aspx.vb(17): error BC30451: Name 'bar' is not declared.

I get a message like this:

Error executing child request for foo.aspx.

Is there any way I can get the a more detailed message while in Application_Error for server.transfer child requests?
Avatar of crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of saitwebdev


Yes.  Thank you very much.

I just did the following:
Dim err As System.Exception = Server.GetLastError()
dim str_errordetails as string
str_errordetails = err.InnerException.Message.ToString()

Open in new window