I set a customer error page redirect in my web.config ..
<system.web>
<customErrors mode="On" defaultRedirect="ErrorPage.aspx" >
</customErrors>
</system.web>
Then in the global.asax
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
Session("LastError") = Server.GetLastError.ToString()
End Sub
when I debug the app ... Session("LastError") is set in app_error event of the global.asax,
but when I go to retrieve it in the Errorpage.aspx .. (to send it in an email ) .. it is set to NOTHING .. why?
<system.web>
<customErrors mode="On" defaultRedirect="ErrorPage.aspx" >
</customErrors>
</system.web>
Then in the global.asax
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
Session("LastError") = Server.GetLastError.ToString()
End Sub
when I debug the app ... Session("LastError") is set in app_error event of the global.asax,
but when I go to retrieve it in the Errorpage.aspx .. (to send it in an email ) .. it is set to NOTHING .. why?