Preparing for an exam, Do you get the default error page if you don't specify the error code inside customError?
I thought since you have defaultRedirect set, all errors regardless if they are accounted for specifically get sent to the defaultRedirect page. However the practice questions I've seen say the opposite. I looked at the documentation and I can only see it say it refers to the default if the custom page doesn't exist
<customErrors mode="On" defaultRedirect="Error.htm">
<error statusCode="500" redirect="/CustomError.html"/>
</customErrors>
Original Question
When a 400-level error occurs, the ASP.NET default error page displays. [True / False]
I believe it's false, answers say it's true.
Do you get the default error page if you don't specify the error code inside customError?
Yes. If you do not specify the error code inside customError, the default error page will be used. if you specify the error code inside customError, the specified page will be used. Of course, customError only applies to elements handled by ASP.NET, so it is possible you can get the IIS error page instead of anything listed in your web.config file.
From the documentation you linked to,
When you define a custom error, ASP.NET assigns to it the standard error normally issued by the underlying service, such as IIS. For instance, if you define a custom error for the status code 404, ASP.NET will issue it anytime you refer to a non-existing .aspx page. The custom errors are only issued for those elements handled by ASP.NET. For instance, if you refer to a non-existing .htm page, IIS issues the standard 404 error.
To answer the specific question you provided,
When a 400-level error occurs, the ASP.NET default error page displays. [True / False]
This is True, since there are no pages specified for 400-level error in the web.config, thus the default error page is used. This assumes the error occurs within the ASP.NET application.