How to handle Error 500 from Web.Config file in ASP.Net

Last Reply on Aug 16, 2014 03:02 AM By EmadKhan

Posted on Aug 15, 2014 05:43 AM

how to deal with error pages ? for e.g this is my web.config file :

 <customErrors mode="RemoteOnly" defaultRedirect="ErrorPages/404.aspx" redirectMode="ResponseRedirect">

      <error statusCode="404" redirect="ErrorPages/404.aspx" />
      <error statusCode="500" redirect="ErrorPages/500.aspx" />
    </customErrors>

<system.webServer>

    <httpErrors errorMode="Custom" existingResponse="Auto">
      <remove statusCode="500" subStatusCode="-1" />
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" path="ErrorPages/404.aspx" responseMode="Redirect" />
      <error statusCode="500" path="ErrorPages/500.aspx" responseMode="Redirect" />
    </httpErrors>
</system.webServer>

now i only know about 400 , that it appears when page is not found .. but what about 500 ? 300 ? 200 ? ?? when these occurs and what they tell a developer to do ?



Posted on Aug 16, 2014 02:52 AM

Check this

http://stackoverflow.com/questions/2480006/what-is-the-difference-between-customerrors-and-httperrors


Posted on Aug 16, 2014 03:02 AM

what i have understand is that

use

Custom Errors only till you are in development phase

and

Http Errors only when u are in IIS or deplyoment phase