Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Web.Config File

Web.Config File

Scheduled Pinned Locked Moved ASP.NET
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saranya B
    wrote on last edited by
    #1

    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?

    S S 2 Replies Last reply
    0
    • S Saranya B

      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?

      S Offline
      S Offline
      Spunky Coder
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • S Spunky Coder

        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

        S Offline
        S Offline
        Saranya B
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • S Saranya B

          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?

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          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!

          S 1 Reply Last reply
          0
          • S Sandeep Akhare

            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!

            S Offline
            S Offline
            Saranya B
            wrote on last edited by
            #5

            Thank You Sandeep :)

            S 1 Reply Last reply
            0
            • S Saranya B

              Thank You Sandeep :)

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              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!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups