[ Download Code ]
This article will be completed in an ongoing multi-part series, one article per element, with the exception being the authorization and authentication elements which are covered together in this article.
This article is intended for the novice ASP.NET developer who may or may not be familiar with utilizing the Web Configuration file. The reader should have a basic understanding of the XML markup language, and be familiar with C# or VB.NET to follow the provided example code. All the screenshots and references to the IDE are of Visual Studio .NET.
- A Web application can contain more than one Web.config file. The settings in a file apply to the directory in which it's located, and all child directories. Web.config files in child directories take precedence over the settings that are specified in parent directories.
- Web.config files are protected by IIS, so your user cannot simply browse to them. If you try to retrieve an existing http://somedomain.com/Web.config file, an "Access denied" error message will be shown.
- There's no need to restart the Web server after you modify a Web.config file. When a change occurs this is detected by ASP.NET on the next request, and the application is reloaded.