I am trying to write my own "Application_Error" for my site.
I need to catch 404's (to see what mistakes users are making) & 500's to catch my programming errors. I did this succesfully in my site before I started using Umbraco in the global.asax.
I have tried the following method.
1: I created a class MyGlobal (file MyGlobal.vb in the App_Code directory:
Public Class MyGlobal
Inherits umbraco.Web.UmbracoApplication
Protected Overloads Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ctx As HttpContext = HttpContext.Current
ctx.Response.Redirect("http://wwww.google.com")
End Sub
End Class
Obivously, this is only to test.
In addition, I editeted my Global.asax file and now it looks like this:
Umbraco 7 - Global.asax - Application_Error
I am trying to write my own "Application_Error" for my site.
I need to catch 404's (to see what mistakes users are making) & 500's to catch my programming errors. I did this succesfully in my site before I started using Umbraco in the global.asax.
I have tried the following method.
1: I created a class MyGlobal (file MyGlobal.vb in the App_Code directory:
Obivously, this is only to test.
In addition, I editeted my Global.asax file and now it looks like this:
I already have "<customErrors mode="Off" />" in my web.config as well as "<httpErrors existingResponse="PassThrough"/>"
1: When I try to enter a non-existent page, i get the Umbraco 404 error page.
2: When I purposely create a 500 error, the system shows me the error page and does not redirect to Google.
Please help as I can not go live without this.
Thanks.
Yoni
is working on a reply...