title: Storing values in the web.config - appSettings or configSection - which is more efficient?
body: <p>I'm writing a page that can use a couple of different themes, and I'm going to store some information about each theme in the web.config.  </p>
  
  <p>Is it more efficient to create a new sectionGroup and store everything together, or just put everything in appSettings?</p>
  
  <p><b>configSection solution</b></p>
  
  <pre><code>&lt;configSections&gt;
      &lt;sectionGroup name="SchedulerPage"&gt;
          &lt;section name="Providers" type="System.Configuration.NameValueSectionHandler"/&gt;
          &lt;section name="Themes" type="System.Configuration.NameValueSectionHandler"/&gt;
      &lt;/sectionGroup&gt;
  &lt;/configSections&gt;
  &lt;SchedulerPage&gt;
      &lt;Themes&gt;
          &lt;add key="PI" value="PISchedulerForm"/&gt;
          &lt;add key="UB" value="UBSchedulerForm"/&gt;
      &lt;/Themes&gt;
  &lt;/SchedulerPage&gt;
  </code></pre>
  
  <p>To access values in the configSection, I am using this code:</p>
  
  <pre><code>    NameValueCollection themes = ConfigurationManager.GetSection("SchedulerPage/Themes") as NameValueCollection;
      String SchedulerTheme = themes["UB"];
  </code></pre>
  
  <p><b>appSettings solution</b></p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="PITheme" value="PISchedulerForm"/&gt;
      &lt;add key="UBTheme" value="UBSchedulerForm"/&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>To access values in appSettings, I am using this code</p>
  
  <pre><code>    String SchedulerTheme = ConfigurationManager.AppSettings["UBSchedulerForm"].ToString();
  </code></pre>