Hello. I am capturing an exception in the above event handler using Server.GetLastError(). I would like to access the Results and SourceCode properties of an inner exception of type System.Web.HttpCompileException, but cannot do so, and am unable to implicitly convert a general exception to System.Web.HttpCompileException. Any ideas?
Thank you in advance,
Chris.
![]() |
0 |
![]() |
Solved my own problem via the following code. Feeling kind of embarrassed over the simple fix.
if (lastErr.InnerException.GetType().ToString() == "System.Web.HttpCompileException") { compileErr = lastErr.InnerException as HttpCompileException; errMsg += "Results: " + compileErr.Results + "<BR>"; errMsg += "Source Code: " + compileErr.SourceCode + "<BR>"; }
![]() |
0 |
![]() |