Trapping the HTTP Error Numbers...

Eduardo Lorenzo
12-10-2006, 11:57 PM
ref: http://www.xtremevbtalk.com/showthread.php?t=27719
I like this thread!

I have tried to do this earlier this morning but didn't work. :mad:

i have this in my global.asax

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
Response.Redirect("../administration/errorpage.aspx")
End Sub

and this fired on the page_load event of errorpage.aspx

Private Sub displayerror()
Dim errmsg As String
Try
errmsg = Server.GetLastError.Message
lbl_Error.Text = errmsg
Catch ex As Exception
lbl_Error.Text = ex.Message
End Try
End Sub

but after

errmsg = Server.GetLastError.Message

errmsg is still = Nothing :mad:

anyone? please?

oh, and I have

<customErrors mode="RemoteOnly"/>

in web.config..

Eduardo Lorenzo
12-11-2006, 12:44 AM
update:

I run the app line by line and the line

Response.Redirect("../administration/errorpage.aspx")

in the global.asax returns me a message

"There is no source code available for the current location"

and I have to hit F5 again for it to continue..

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum