Last post Sep 22, 2010 10:33 AM by ravikatha
Sep 22, 2010 10:24 AM|joecool2005|LINK
I have more than 1 web.config in my project. When I added the following lines to all web.config
<customErrors mode="On" defaultRedirect="~/error.htm" />
there will be a conflict between them.
How can I add to all files?
Sep 22, 2010 10:33 AM|ravikatha|LINK
When you set the customErrors in your root web.config, it will be inherited to all child web.config.
If you remove the allowOverride attribute for location in the root config, then you can override this setting in child web.config with different settings. If you set the allowOverride attribute to false for the root config, then you cannot override this
setting in child web.config with different settings and all child configs ingerit the same value as in the root config.
When ASP.NET needs to take an action when an error occurs, it uses the web.config in the same folder as the currently executing aspx page. So if you specified the customErrors in the root web.config, they will get inherited to the child folders as well.