Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is <customErrors mode="Off" /> for?

Tags:

asp.net

What is this for?

ASP.NET error suggested that I have to put this in my web.config file. What do these lines of codes do?

<system.web>
    <customErrors mode="Off"/>
</system.web>
like image 768
danielle Avatar asked Nov 25 '25 00:11

danielle


2 Answers

You can read about <customErrors> element here on MSDN.

Specifically:

Specifies that custom errors are disabled. The detailed ASP.NET errors are shown to the remote clients and to the local host.

like image 140
Lloyd Avatar answered Nov 26 '25 16:11

Lloyd


Custom Error

To customize the default error page, one will have to change the default configuration settings of the application

There are three error modes in which an ASP.NET application can work:

  • Off Mode
  • On Mode
  • RemoteOnly Mode

The Error mode attribute determines whether or not an ASP.NET error message is displayed. By default, the mode value is set to "RemoteOnly".


Off Mode

When the error attribute is set to "Off", ASP.NET uses its default error page for both local and remote users in case of an error.


On Mode

In case of "On" Mode, ASP.NET uses user-defined custom error page instead of its default error page for both local and remote users. If a custom error page is not specified, ASP.NET shows the error page describing how to enable remote viewing of errors.


RemoteOnly

ASP.NET error page is shown only to local users. Remote requests will first check the configuration settings for the custom error page or finally show an IIS error.


More Details and referred from here and this MSDN Site

like image 24
Ramesh Rajendran Avatar answered Nov 26 '25 18:11

Ramesh Rajendran