global.asax Application_Error event always being triggered

Discussion in 'ASP.NET / ASP.NET Core' started by Will1968, Jan 6, 2009.

  1. Hi,

    I have created a global.asax file and set CustomErrors to On in the webconfig file.

    However my Application_Error sub procedure in the global.asax file always seems to be executed even if there are noerrors present.

    Is this to be expected? It seems to be an unnecessary overhead.

    Will
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    application_error should only fire when there's an error with the application.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Yes that is what I thought. Not sure why mine seems to fire all the time with no error occuring.


    I think I will create a fresh project and drop one object back into it at a time and see at what point the application error starts being triggered and then hopefully ascertain the error.


    Tks


    Will
     

Share This Page