T
tshad
I am setting up some exception handling and was wondering if the
Application_Error in the Global.asax is different than the customerErrors in
web.config.
Sub Application_Error(Sender As Object, E as EventArgs)
Dim LastException as String = Context.Error.ToString()
Context.ClearError()
response.Redirect("/PageError.aspx")
response.Redirect("/PageError.aspx?Err=" &
Server.GetLastError().ToString())
response.Redirect("/PageError.aspx?Err=" &
Server.UrlEncode(LastException))
response.Redirect("/PageError.aspx?Err=" & LastException)
End Sub
or
<customErrors mode=on defaultRedirect="/PageError.aspx">
Would you use only one or the other or would you use both?
If you were to use both, which one gets handled first?
Thanks,
Tom
Application_Error in the Global.asax is different than the customerErrors in
web.config.
Sub Application_Error(Sender As Object, E as EventArgs)
Dim LastException as String = Context.Error.ToString()
Context.ClearError()
response.Redirect("/PageError.aspx")
response.Redirect("/PageError.aspx?Err=" &
Server.GetLastError().ToString())
response.Redirect("/PageError.aspx?Err=" &
Server.UrlEncode(LastException))
response.Redirect("/PageError.aspx?Err=" & LastException)
End Sub
or
<customErrors mode=on defaultRedirect="/PageError.aspx">
Would you use only one or the other or would you use both?
If you were to use both, which one gets handled first?
Thanks,
Tom