F
Fred Nelson
I'm devloping a VB.NET web application and I'm having a problem with
trapping errors and logging the cause of them. When an unexpected error
occurs I want to write it to a file - or e-mail it to me. I have set up
everything according to the documentation however when I get to my error
page "errorpage.aspx" I can't determine why I'm there!
In my web.config file I have the line:
<customErrors ... defaultredirect="errorpage.aspx">
In my global.asax file I have:
sub application_error
server.transfer("errorpage.aspx")
This is sending me to errorpage.aspx when an error occurs.
-------
In errorpage.aspx I have the following:
Imports System
imports system.web
imports system.web.ui
imports system.diagnostics
imports system.application exception
page_load
dim currenterror as new exception = server.getlasterror
The problem is that currenterror is always NULL so I can't do anything!
I'm sure I'm only missing one step to obtain the error - I'm following the
MSDN example and that in a book exactly and its not working.
Any help with this would be GREATLY appreciated!
Thanks Fred
trapping errors and logging the cause of them. When an unexpected error
occurs I want to write it to a file - or e-mail it to me. I have set up
everything according to the documentation however when I get to my error
page "errorpage.aspx" I can't determine why I'm there!
In my web.config file I have the line:
<customErrors ... defaultredirect="errorpage.aspx">
In my global.asax file I have:
sub application_error
server.transfer("errorpage.aspx")
This is sending me to errorpage.aspx when an error occurs.
-------
In errorpage.aspx I have the following:
Imports System
imports system.web
imports system.web.ui
imports system.diagnostics
imports system.application exception
page_load
dim currenterror as new exception = server.getlasterror
The problem is that currenterror is always NULL so I can't do anything!
I'm sure I'm only missing one step to obtain the error - I'm following the
MSDN example and that in a book exactly and its not working.
Any help with this would be GREATLY appreciated!
Thanks Fred