mardi 4 août 2015

global.asax Application_Error event not firing

In my web.config, I don't have anything like CustomErrors. As I want everything to be handled by Global.asax .

This is my web.config:

<?xml version="1.0"?>

<configuration>
  <system.web>
    <compilation targetFramework="4.5" debug="false"/>
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" >
      </forms>
    </authentication>

    <httpRuntime requestPathInvalidCharacters="&lt;,&gt;,:,\,?" targetFramework="4.5" maxRequestLength="1048576"/>

    <httpModules>
      <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/>
    </httpModules>

  </system.web>

  <system.webServer>

    <validation validateIntegratedModeConfiguration="false"/>

    <modules>
  <add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule"/>
  <remove name="UrlAuthorization"/>
  <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
  <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/>
</modules>
    <security>
      <requestFiltering allowDoubleEscaping="true">

      </requestFiltering>
    </security>

  </system.webServer>

</configuration>

And this is Application_Error event in Global.asax :

void Application_Error(object sender, EventArgs e)
{
    try
    {
        Response.Redirect("~/error.html");
    }
    catch
    {
    }
}

Do I need web.config?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire