what is the use of web.config in asp.net?

what is the use of web.config in asp.net?


kalyan
Views: 3160 | Community Opinion: 15

Tags..  ASP.NET Interview

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 

Web.config file in ASP.NET, as it sounds like is a configuration file for the Asp .net web application. An Asp .net application has one web.config file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings.

Generally we store database connections, Session States, Error Handling, Security configurations in ASP.NET web.Config file.

Multiple configuration files, all named Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. Configuration files in child directories can supply configuration information in addition to that inherited from parent directories, and the child directory configuration settings can override or modify settings defined in parent directories. The root configuration file named systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config provides ASP.NET configuration settings for the entire Web server.




kalyan Said..

good




rajkumar Said..

Fine




Kranthi Kumar Said..

Web.config acts as a central location for storing the information to be accessed by web pages. This information could be a Connection String stored at a centralized location so that it can be accessed in a data-driven page. If the connection string changes its just a matter of changing it at one place.

In classic ASP such global information was typically stored as an application variable.

In the sample we'll read the information from web.config using ASP.NET and ASP as there could be a possibility of project having ASP and ASP.NET pages.

web.config:

Contains a key-value pair.
web.config





















string strConnection;
strConnection = ConfigurationSettings.AppSettings["ConnectionString1"];
Response.Write(strConnection);




Anitha Said..

good




sai Naveen Said..

good




VIvek Said..

correct




mohamed Said..

Good




amit.chandra Said..

very very ok.





f




not bad Said..

ths data processing one page to other page




kavitha Said..

the data is processing one page to other page within the web page




vivek k Said..

1.Web.Config file is a configuration files in ASP.Net.
2.By Default only one file you can see in a project but you can add multiple config file.
3.Basically Web.config file is a XML format.
4.You can keep you connection,Session,Keys,Security in a web.config file.
5.You can also handle a error from config file also.






Register or Login to Post Your Opinion