Click here to Skip to main content
15,919,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Can any one explain (with out giving unusefull links...) what is the main difference between IIS custom error tab and web.config custom error section and when we will use IIS custom errors and when we go for web.config custom error?

I came to know by google that .aspx files will not be handled in IIS..is it true?why?

If we have any html page in our application and an error occured in this page which one will handle this?


Thanks
Vinay
Posted

1 solution

Hi Vinay,

MSIL
 IIS Custom errors are Error messages for HTTP Errors some of them are as below

200 - OK
400 - Bad request
401 - Access denied
401.1 - Logon failed
403.1 - Execute access forbidden
404.0 - (None) – File or directory not found


Web.Config Custom error messages are of three types

XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors defaultRedirect="url"
              mode="On|Off|RemoteOnly">
   <error statusCode="500"
          redirect="InternalError.htm"/>
</customErrors>

</system.web>
</configuration>


If Mode is OFF then this specifies that custom errors are disabled. This allows display of detailed ASP.net errors

If Mode is ON then this specifies that custom errors are enabled. If no defaultRedirect is specified, users see a generic ASP.NET error

If Mode is Remote then this specifies that custom errors are shown only to remote clients and ASP.NET errors are shown to the local host. This is the default.

defaultRedirect :Specifies the default URL to direct a browser to if an error occurs. When defaultRedirect is not specified, a generic error is displayed instead
 
Share this answer
 
Comments
sowvin 26-Jul-10 3:48am    
Hi Rejesh,

Thanks you very much for your answer.

I have a correction for you.According to my research IIS processes requests for static content like images and HTML files without invoking the ASP.NET engine.
So any error in HTML or static content like images it will display IIS custom error pages.

For .ASPX the web.config error pages will display..

Hope myt research will help others....:)

Cheers
Vinay
Rajesh Sajjanar 26-Jul-10 14:04pm    
Hi Vinay, your understanding for custom errors , for "any error in HTML or static content like images it will display custom error pages" is wrong. Before posting you should understand better dont post wrong comment/ answer, I hope you didn't read my answer and you posted comment as correction to my answer.
Let me know you need any information
sowvin 10-Dec-10 2:08am    
Hi Rajesh,
Sorry yaar if I hurt you...I never mentioned that "any error in HTML or static content like images it will display custom error pages". I am saying it won't be handled by ASP.NET engine and it will be handled by IIS.
Regards
Vinay

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