I have a custom error that displays ok but i also wanted to send a detailed email to the site admin informing them of the error.
I've found several examples that seem to do this by setting
In the web.config file.VB Code:
<customErrors mode="On" defaultRedirect="errorpage.aspx" />
From this i can get the path for the file that caused the error as suchI'd also like to get more detailed information though which i've tried doing as specified in the many samples i've foundVB Code:
Dim ErrorUrl As String = Request.Params("aspxerrorpath").ToStringThe idea then being to build up the body of the email to send with the path of the error and a detailed description of it. But i don't seem to be able to get both events to fire as if i have code in the application_error event then the user doesn't get redirected to the errorpage.VB Code:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Fires when an error occurs Dim objError As Exception = Server.GetLastError() HttpContext.Current.Application.Add("lastException", objError) Server.ClearError() End Sub
Any idea's whats going wrong/on?


Reply With Quote