Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Global.asax is not firing event "Application_Error" on server
it is working fine on local computer..but not working properly on server.

Please,let me help

Thank you in advance
Posted

1 solution

My guess is that the account the appplication is running under does not have rights to create your xxx.log file or there is some other problem with that first bit of code and so that is causing an error, and therefore because you have no error handling in your Application_Error method it just falls out.

You could try just putting a redirect in the top of the method to some weird page and if it goes to your weird page you know it is definitely hitting the code then you just have to resolve why it is failing.

Could you include the below code in Global.asax
C#
void Application_Error(object sender, EventArgs e)
{
    Exception objErr = Server.GetLastError().GetBaseException();
    //.... my own implementation goes here ...
    Server.ClearError();
    Server.Transfer("~/About.aspx");
}
 
Share this answer
 
v2
Comments
pal5hah 23-May-12 0:19am    
Yes sir,
I have included code..
the code was exactly as u have written.
i have redirected to one page...but its not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900