web.config vs. global.asax

Results 1 to 2 of 2

Thread: web.config vs. global.asax

  1. #1
    Join Date
    Dec 1969

    Default web.config vs. global.asax

    Is there any reason to store values (i.e. a db connection string) in the web.config as opposed to creating an application variable in the global.asax?

  2. #2
    Join Date
    Dec 1969

    Default RE: web.config vs. global.asax

    variables stored in web.config can be accessed directly with a static method, so you don't need to have access to the http application context. In global.asax, if you don't have access to the http application context, for example, when you have a stand alone class that has nothing to do with any aspx, then you will need to get the connection string from the web.config

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts