Click Here To Get Amazing Facebook Profile Covers,Status Messages

configuration file for asp.net web application web.config

Web.config is an XML file which specifies settings and configuration for your web application written in ASP.NET. You can use any text editor like notepad or xml parser to edit settings in this configuration file. This file contains information regarding security, session, compilation, app language and database connection strings.

The root of web application contains initial Web.config file for that application. Multiples files with same name can be placed in sub directories of web application to control configuration settings for the files placed in that sub directory. Web.config files placed in sub directories can add certain configuration settings to the settings inherited from web.config file of parent directory. The settings in sub directory can override the settings specified in parent directory.

The file SystemRootMicrosoft.NETFrameworkversionCONFIG machine.config is default configuration file which contains configuration settings regarding ASP.NET for web server. The configuration settings for every URL resource are determined at run time from the configuration settings specified in the various web.config files in hierarchy up to that file. These settings are then cached for future requests. Any changes in settings specified in web.config files in hierarchy are reflected when a request is made to the resource and this configuration information is re cached for that resource. So there is no need of restart server, sort of things to make changes in settings effective.

appSettings tag of web.config file is used to store connection strings and global variables sort of things. This is something like key value pair.For example

; database = DBNAME>; user id = ; password="/>

This value of ConnectionInfo can be used anywhere throughout your web application using

ConfigurationSettings.AppSettings["ConnectionInfo"]; statement.

Happy Coding

Your rating: None Average: 5 (1 vote)