Udostępnij za pośrednictwem


Custom Element for SingleTagSectionHandler

Defines settings for custom configuration sections that use the SingleTagSectionHandler Class.

<configuration>
**      <sectionName>**

<sectionName
   key="value"
   key2="value2"/>

Attributes

Attributes are user defined.

Remarks

The <sectionName> element is a custom element defined by a <section> tag in the <configSections> element. The configuration system returns a System.Collections.IDictionary object when you call ConfigurationSettings.GetConfig.

Example

The following example declares a custom element called <sampleSection>, which contains settings read by the SingleTagSectionHandler class.

<configuration>
   <configSections>
      <section name="sampleSection"
               type="System.Configuration.SingleTagSectionHandler" />
   </configSections>
   <sampleSection setting1="Value1" setting2="value two" 
                  setting3="third value" />
</configuration>

Configuration File

This element can be used in the application configuration file, machine configuration file (Machine.config), and Web.config files that are not at the application directory level.

See Also

Configuration Sections Schema | Configuration Section Settings