Web.Config File
-
Friends, I am just a beginner and I have some doubts with web.config file. It would be helpful to me if anyone come up with answers for these questions. 1. When a web.config file is called in a .net web application? 2. Is it possible to have more than one web.config file for an applicaiton? 3. What is the concept behind declaring the connection string in web.config file? 4. What is the difference between app.config and web.config files?
-
Friends, I am just a beginner and I have some doubts with web.config file. It would be helpful to me if anyone come up with answers for these questions. 1. When a web.config file is called in a .net web application? 2. Is it possible to have more than one web.config file for an applicaiton? 3. What is the concept behind declaring the connection string in web.config file? 4. What is the difference between app.config and web.config files?
web.config is used with web applications. web.config will by default have several configurations required for the web application. You can have separate web.config files for each directory in your web application, in addition to the one in the root. For each web page, by default, system will look for a web.config in the same folder as the page and if not found, then looks in the parent folder. app.config is used for windows applications. When you build the application in vs.net,i think it is same as web.config but not sure... declaring a connection string in the web.config file is as to declare connection strring once and use in different webforms otherwise in each webform we have to declare connection string which is redundant.the string can be retrieved as follows System.Configuration.COnfigurationSettings.AppSettings["Key"] Koushik
-
web.config is used with web applications. web.config will by default have several configurations required for the web application. You can have separate web.config files for each directory in your web application, in addition to the one in the root. For each web page, by default, system will look for a web.config in the same folder as the page and if not found, then looks in the parent folder. app.config is used for windows applications. When you build the application in vs.net,i think it is same as web.config but not sure... declaring a connection string in the web.config file is as to declare connection strring once and use in different webforms otherwise in each webform we have to declare connection string which is redundant.the string can be retrieved as follows System.Configuration.COnfigurationSettings.AppSettings["Key"] Koushik
Thanks for your reply Kousik. But when this web.config file is called? Is it that, each time when a user request for a page, the web.config file is called? Or, is it like, web.config is called only when we try accesing the variable/key declared and stored in web.config? -Saranya
-
Friends, I am just a beginner and I have some doubts with web.config file. It would be helpful to me if anyone come up with answers for these questions. 1. When a web.config file is called in a .net web application? 2. Is it possible to have more than one web.config file for an applicaiton? 3. What is the concept behind declaring the connection string in web.config file? 4. What is the difference between app.config and web.config files?
HI Friend Asked a meaning full question
Saranya B wrote:
1. When a web.config file is called in a .net web application?
At run time (When Application runs) common language runtime reads (such as assembly binding policy, remoting objects, and so on), and settings that the application can read.
Saranya B wrote:
2. Is it possible to have more than one web.config file for an applicaiton?
Yes , Web.config files can appear in multiple directories in ASP.NET applications.
Saranya B wrote:
3. What is the concept behind declaring the connection string in web.config file?
Security and Consistent Suppose if the connection string has changed then i need to change it only once i.e. in the web.config other wise i have to check each and every page and update it.
Saranya B wrote:
4. What is the difference between app.config and web.config files?
app.config is used for windows applications. When you build the application in vs.net, it will be automatically renamed to .exe.config and this file has to be delivered along with your application. If you make any changes to the web.config, web application will immediately load the changed config. But in case of .exe.config, you have to restart the application.
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
HI Friend Asked a meaning full question
Saranya B wrote:
1. When a web.config file is called in a .net web application?
At run time (When Application runs) common language runtime reads (such as assembly binding policy, remoting objects, and so on), and settings that the application can read.
Saranya B wrote:
2. Is it possible to have more than one web.config file for an applicaiton?
Yes , Web.config files can appear in multiple directories in ASP.NET applications.
Saranya B wrote:
3. What is the concept behind declaring the connection string in web.config file?
Security and Consistent Suppose if the connection string has changed then i need to change it only once i.e. in the web.config other wise i have to check each and every page and update it.
Saranya B wrote:
4. What is the difference between app.config and web.config files?
app.config is used for windows applications. When you build the application in vs.net, it will be automatically renamed to .exe.config and this file has to be delivered along with your application. If you make any changes to the web.config, web application will immediately load the changed config. But in case of .exe.config, you have to restart the application.
Thanks and Regards Sandeep If you want something you never had, do something you have never done!
-
My Pleasure Hi Saranya I read all your post and from which i came to know one thing that you have asked really meaningfull question keep it up dude with keeping same quality in your queries
Thanks and Regards Sandeep If you want something you never had, do something you have never done!