What is AppSetting Section in “Web.Config” file?
Web.config file defines configuration for a webproject.
AppSetting section is used to set the user defined values. For e.g.: The ConnectionString which is used through out the project for database connection.
<configuration>
<appSettings><BR><addkey="ConnectionString"value="server=xyz;pwd=www;database=testing" />
</appSettings>
What is AppSetting Section in “Web.Config” file?
AppSetting section in the configuration file is a section that allows us to keep configurable and application wide settings (for e.g.: ConnectionString) that an application requires in order to perform the tasks properly. This helps in easy maintenance and deployment of the application.
Web.confg:<appsettings>
<add key="ConnectionString" value="(your connection string)" />
</appsettings>
Code behind:string strConnection = ConfigurationSettings.AppSettings["ConnectionString"];