ASP Configue file


0  0 2016-03-15 10:00:07

The behavior of Asp.Net application is affected by different type of setting in configuration files.
1.  Web.Config
2.  Machine.config

machine.config file contains default & the machine-specific value for all supported settings in application. This machine setting is controlled by applications which are not generally given access to this file & system administrator. The application contains child directories it define where the web.config file is available. And web.config file for each folder in root folder.

The Web.config file are not only for securing to your application but also for wide range of other purposes which it is intended for the Asp.Net Web.config file provides you a flexible way to handle  your requirements at application level.

Following is the code for snippet that shows basic syntax of a configuration file:
    /* Configuration section-handler declaration area.*/
    <section name="First" type=" FirstHandler" />                  
    <section name="Second" type=" SecondHandler" />     

   /* Configuration section settings area. */
      <s1Setting1 attribute1="attr1" />

      <s2Setting1 attribute1="attr1" />

      <authentication mode="Windows" />

1.) Application Settings :-
Application settings allow storing application to wide name value pairs for read only access.
Example, we can define custom application setting such as:-

      <add key="App Name" value="MyApp"/> 

      <add key="appISBN" value="0-234-54231-9" />
      <add key="appBook" value="ASP.NET" />

2.) Connection Strings:-
The connection strings show which database connection strings are available to the website.

    <add name="ASPDotNetConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\\projects\datacaching\datacaching\App_Data\ASPDotNet.mdb"  providerName="System.Data.OleDb" />
    <add name="NewBookConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ \databinding\App_Data\NewBook.mdb" providerName="System.Data.OleDb" />


Comments (0)

Post Your Comments


Hong Kong Office

Find Us On

Website Development Company
Digital Marketing
website development company in Hong Kong
website designer in pune