| |||||||||
<configSections> clear ElementASP.NET Syntax ASP.NET Configuration Sections Removes all references to inherited sections and section groups, allowing only the sections and section groups that are added by the current section and sectionGroup elements. <clear /> Attributes and ElementsThe following sections describe attributes, child elements, and parent elements. AttributesNone. Child ElementsNone. Parent Elements
RemarksThe clear element removes all references to inherited sections and section groups, allowing only the sections and section groups that are added by the current section and sectionGroup elements. If a configuration file tries to use a configuration section after the handler reference is removed, ASP.NET issues the server error, ExampleThe following code example shows how to use the clear element in an application configuration file to clear sections that were previously defined in the Machine.config file. The following code from a Machine.config file declares two sections, <configuration>
<configSections>
<section name = "sampleSection"
type = "System.Configuration.SingleTagSectionHandler" />
<section name = "anotherSampleSection"
type = "System.Configuration.NameValueSectionHandler" />
</configSections>
<sampleSection setting1 = "Value1"
setting2 = "value two"
setting3 = "third value" />
</configuration>
The following code from an application configuration file clears all previously declared sections. The application cannot use or retrieve settings in either of the sections that were declared in the Machine.config file. However, the application can use settings from <configuration>
<configSections>
<clear />
<section name = "anotherSection"
type = "System.Configuration.NameValueSectionHandler" />
</configSections>
</configuration>
See Also<configSections> Section <configSections> remove Element <configSections> section Element <configSections> sectionGroup Element |
| ||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme