How to reference web.config from class

G

Guest

In my asp.net application, I have created a class for
global variables and functions, and I have placed
this in the app_code directory so it is available to all my pages.
That part has worked fine.
But now, I need to add a new funtion in this class which
needs to reference web.config. How do I get a reference
to web.config from this class?
In other words, all my aspx pages are hooked up to
web.config automatically, but not a class which I have
placed in /app_code.

TIA!!
Tom
 
T

Trevor Braun

You'll also have to add a new project reference to System.Configuration or
you won't see the ConfigurationManager class.

Trevor
 

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

Top