No I figured it out..
Since you are redirected to another errorpage you loose the GetLatsetError
information, cause you are not on that page anymore.. BUT.. if you in
Global.aspx in Page_error event (where it's still accessible) put
Server.GetLastError in a SESSION variable.. you can get it thru that on the
Errorpage ..
/Lars
"Shiva" <sh******@online.excite.com> skrev i meddelandet
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,
Check whether Server.GetLastError() returns any error object before
accessing its properties.
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
I'm trying to make my own custom error page... but when using
Try
lblErrormessage.Text = Server.GetLastError.Message
lblErrormessage.Text += "<br>" & Server.GetLastError.StackTrace
lblErrormessage.Text += "<br>" & Server.GetLastError.Source
Catch ex As Exception
lblErrormessage.Text = ex.Message
End Try
It goes into the Catch and says "Object reference not set to an instance
of an object." I have debugged alittle and Server is avaliable.. but
GetLastError gives the error..
Do I need to enable something in order to use this?
Regards/Lars Netzel