Hello, i have configured custom error handling page for status code 404 with factory configuration and it works. But when i try to include 400 and 405 status code it is not working. How can i add these two status code to web.config?

Hi Phone, 

Have you checked by Add new line for different error between <httpErrors> tag? 

like : 

<httpErrors>

         <error statusCode="400" path="" SubStatusCode="0" responseModel="" />

         <error statusCode="405" path="" SubStatusCode="0" responseModel="" />

</httpErrors>


Can you please try with this option.


Thanks 

Jitender Gaur wrote:

Hi Phone, 

Have you checked by Add new line for different error between <httpErrors> tag? 

like : 

<httpErrors>

         <error statusCode="400" path="" SubStatusCode="0" responseModel="" />

         <error statusCode="405" path="" SubStatusCode="0" responseModel="" />

</httpErrors>


Can you please try with this option.


Thanks 


Hi Jitender Gaur, I've tried that option. It does not work. Any solution?

<xsl:template match="/configuration/system.web/customErrors/error">

<xsl:copy>

<xsl:attribute name="statusCode">404</xsl:attribute>

<xsl:attribute name="redirect">/parent/PageNotFound.aspx</xsl:attribute>

</xsl:copy>

</xsl:template>


This is something that is working it has some differences from what you have. Not sure if those differences are important. 

Yet is with the same status code that is working for you. I'd assume that adding new lines for new status codes would work. 

Have you tried creating a new entry on Factory Configuration for another status code? (instead of being in the same entry)