In this article I will explain, the customError setting in the Web.Config file of ASP.Net application, how it works, what is its use and what are the different modes of the customError setting in the Web.Config file of ASP.Net application.
The customError setting in the Web.Config file has three modes Off, On and RemoteOnly.
 
 
Custom Error Mode setting in ASP.Net Web.Config file
The customError setting is a security feature in ASP.Net and is built to secure the websites from hackers by hiding the actual error details from them.
Whenever an error occurs in the website, instead of showing the actual error details, ASP.Net shows the follow page to the end user.
Custom Error Mode setting in ASP.Net Web.Config file
 
Developers can easily enable or disable this feature by adding the customError setting the system.web section of the Web.Config file and setting the appropriate Mode.
The customError setting has three Modes.
On (Default) – Even the customError setting is not present in the Web.Config file the default Mode is On and the actual error details will always be hidden i.e. it will not be shown when the website is accessed on server or any client machine.
RemoteOnly (Recommended) – This setting will hide the error details from the end users i.e. when accessed from client machines but when the website is accessed on server where it is hosted then the actual error details will be shown.
Off – This setting will turn off the feature and the complete error details will be shown to everyone. Generally turning this setting Off is not recommended.