Using the <appSettings> Configuration Section

The appSettings section, as mentioned previously, is used to hold developer-defined configuration values. These values are stored as text strings in the configuration file. An example of the appSettings configuration section is shown in Listing 3.3.

Listing 3.3. Example of the <appSettings> Section of the web.config File
01 <configuration> 
02   <appSettings> 
03     <add key="appName" value="ProjectPal" /> 
04     <add key="appAuthor" value="Scott Worley, et al" /> 
05   </appSettings> 
06 
07 </configuration> 

In Listing 3.3, are two appSettings entries; these are

  • appName— Name of the application.

  • appAuthor— Author of the application.

These settings are added by using the <add /> element of the appSettings configuration ...

Get Inside ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.