I have a custom error page set up for my application:
<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx"
/>
In Global.asax, Application_Error(), the following code works to get the exception details:
Exception ex = Server.GetLastError();
if (ex != null)
{
if (ex.GetBaseException() != null)
ex = ex.GetBaseException();
}
By the time I get to my error page (~/errors/GeneralError.aspx.cs), Server.GetLastError() is null
Is there any way I can get the exception details on the Error Page, rather than in Global.asax.cs ?
ASP.NET 3.5 on Vista/IIS7
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…