ConfigurationSettings can't be seen from a code behind class?

A

Andrew Fisher

Hi all,

I have set up some config options in the web.config file and have
successfully used them in my test pages. When I came to abstract my
code from the design - by using code behind files, all of a sudden I am
told I can't use the ConfigurationSettings object because it isn't
referenced as a namespace.

I understand what the compiler is telling me is the problem but I'm not
sure what namespaces I need to include to make this work?
Any help or suggestions would be greatly appreciated.

Cheers
AndrewF
 
J

Juan T. Llibre

Yoiu need to import the
System.Configuration.ConfigurationSettings class.

Add

Imports System.Configuration.ConfigurationSettings

at the top of your codebehind file.



Juan T. Llibre
ASP.NET MVP
===========
 
A

Andrew Fisher

Hi Juan and Steve,

Works perfectly - thanks loads for that. I hoped it would be something
simple like that

Cheers
AndrewF
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top