It is difficult for me to execute the On_Error event in the Global.asax file. When the application receives an error, it should go to the Global.asax file, register the error in the database and redirect to the user error page. The above code works fine in my local, but as soon as I deploy it on a DEV machine, Global.asax is not executed.
It always redirects to the custome error page specified in web.config
<customErrors mode="On" defaultRedirect="/Error_Redirect.asp">
<error statusCode="404" redirect="/404.asp"/>
</customErrors>
The structure of the project in IIS is similar to Test1 \ Test 2. The error handling code that I am trying to use is in Test 2 and its virtual dictator in IIS. If I have an error in the web.config file, for example, "The section has already been mentioned", then the error gets into the Global.asax file. If there are any runtime errors, as shown below, it does not fit the Global.asax file.
Int32 i, j, k;
i = 10;
j = 0;
k = i / j;
Response.Write(k);
. I'm even tired setting Off / RemoteOnly. Any suggestions?
Thank,
source
share