Is there any way for me to get the page that errored and the error
from the ErrorPage.aspx?

I've tried Request.ServerVariables("HTTP_REFERRER") and
Server.GetLastError().InnerException to no avail.Both are either null
or blank everytime.

Dim ErrorDetail As String = ""
If Not Server.GetLastError Is Nothing Then
ErrorDetail =
Server.GetLastError().InnerException.ToString
End If
Dim page As String =
Request.ServerVariables("HTTP_REFERRER")

Advertisements

"jobs" <> wrote in message
news:...
[clip]
> Is there any way for me to get the page that errored and the error
> from the ErrorPage.aspx?
>
> I've tried Request.ServerVariables("HTTP_REFERRER") and
> Server.GetLastError().InnerException to no avail.Both are either null
> or blank everytime.
>
>
> Dim ErrorDetail As String = ""
> If Not Server.GetLastError Is Nothing Then
> ErrorDetail =
> Server.GetLastError().InnerException.ToString
> End If
> Dim page As String =
> Request.ServerVariables("HTTP_REFERRER")
[clip]

I use HttpContext.Current.Request.RawUrl to get the full URL of the request
that caused the error.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!