What is AppSetting Section in "Web.Config" file?

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"];
Difference between Server.Transfer and response.Redirect
Following are the major differences between them :- Server.Transfer - The browser is directly redirected to another page...
Difference between Authentication and authorization.
Authentication is the process of verifying the identity of a user....
What is impersonation in ASP.NET?
ASP.NET can also impersonate a specific account you specify in web.config...
Post your comment