
180
|
Chapter 8: ASP.NET Configuration
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
the settings in a web.config file in a subdirectory will override those in a web.
config file in the parent directory.
ASP.NET provides a facility for locking down configuration set-
tings so they cannot be overridden by child configuration files. If a
configuration setting has been locked down in machine.config,an
exception will be thrown if you attempt to override that setting in
web.config. In addition, certain settings are limited to machine or
application scope. Attempting to override these settings at applica-
tion or subdirectory scope will also result in an exception being
thrown.
The syntax of the machine.config and web.config files is based on XML. Each
configuration section consists of a parent element that may in turn contain
attributes or child elements. In the following snippet, the
<configuration> and
<system.web> elements are standard elements that are required in each web.config
file. The
<authentication> and <authorization> elements are parent configuration
elements, while the
<deny> element is a child element of the <authorization>
element:
<configuration>
<system.web>
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<configuration>
The configuration of an ASP.NET application depends on ...