relation GLOBAL.ASAX and WEB.CONFIG

T

teo

I put some variables in a web.config file

I have a global.asax file that needs to use
one of those variables

How can global.asax read that value?

If I have more than one web.config file,
how can the global.asax detect the right web.config file ?
 
T

Tim Mackey

hi teo,
you should read this section of the docs on web configuration, it will tell
you everything you need to know about reading values from web.config:
http://msdn2.microsoft.com/en-us/library/system.web.configuration.webconfigurationmanager.aspx

for your nested web.config scenario, have a read of the OpenWebConfiguration
method of the WebConfigurationManager class, it allows you to open a
specific configuration section based on the virtual path of the application.

good luck
tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Global.asax not checking the GAC 2
Global.asax 1
connectionstring in global.asax or web.config? 6
Global.asax 1
Global.asax 1
questions 6
Global.asax or web.config 3
Using HttpModules instead of Global.asax 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top