src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
Web.Config in Asp.Net
Need of Web config file
The webconfig file is used to configure the general settings to the iis and the sourceASP.NET uses these web.config configuration files to hierarchically compute a unique collection of settings for each incoming URL target request (these settings are calculated only once and then cached across subsequent requests; ASP.NET automatically watches for file changes and will invalidate the cache if any of the configuration files change).And redirect or set the setting
Basically it’s a XML based file and Each web.config file applies configuration settings to the directory it is located in and to all virtual child directories beneath it
Configuration Section
A web.config file is an XML-based text file that can contain standard XML document elements, including well-formed tags, comments, text, cdata, and so on. The file may be ANSI, UTF-8, or Unicode; the system automatically detects the encoding. The root element of a web.config file is always a
All configuration information resides between the
Configuration section handlers - The ASP.NET configuration infrastructure makes no assumptions regarding the file format or supported settings within a web.config file. Instead, it delegates the processing of web.config data to configuration section handlers, .NET Framework classes that implement the IConfigurationSectionHandler interface. An individual IConfigurationSectionHandler declaration needs to appear only once, typically in the machine.config file. The web.config files in child directories automatically inherit this declaration. Configuration section handlers are declared within a web.config file using section tag directives nested within a
Configuration section groups - ASP.NET configuration allows hierarchical grouping of sections for organizational purposes. A
Configuration sections - ASP.NET configuration settings are represented within configuration tag sections, also nested within a
System.Configuration.HttpModulesConfigurationHandler
class is responsible for interpreting the content contained within the
Using Location and Path
By default, all configuration settings defined within the top-level
Here I do give a simple example to connect with Sql Server or Oracle
//To get the values of the connections strings you would use
string conn = ConfigurationSettings.AppSettings["ORACLEConnectionString"];
OleDbConnection myConnection = new OleDbConnection(conn);
//When the site goes live change the debug setting to false which will make the site have a little better //performance.
//Customer errors can be handled be turned off but I prefer them to be turned on as below.
Or
//Application Tracing can be set up while shows the output times and all sorts of info of every page if you //set it the values to true below. Local only would mean only onthe webserver hosting the site. You can also //do per page tracing so that you can turn off applicationTracing and have trace="true" at the top of a single //page.