I ran across a situation working on an Intranet application where I did not want a sub directory (which was a seperate web application) to inherit the parent/root web applications web.config settings. I searched around and found an article about the lock attributes for sections and elements in the web.config, but that was not working. Basically what was happening is that when I went to the sub application via http://mainsite/subApp the subApp would fail because it said it couldn't find a reference to a setting I had in my root applications web.config (in my case it was a tagMapping and HttpModule settings).
The following takes care of this type of situation.
In the root web.config file I wrapped my <system.web> section with the following tags:
<location path="." inheritInChildApplications="false">
<system.web></system.web>
</location>
This allows all child applications to use its web.config only and not worry about anything in the parents web.config. The following URL is an MSDN article about it:
http://msdn2.microsoft.com/en-us/library/system.configuration.sectioninformation.inheritinchildapplications.aspx
dcc6afa9-a48c-465e-9782-4deed5ff0a5c|3|5.0
ASP.NET
asp.net, web.config