Advertisement

04.07.2008 at 09:26PM PDT, ID: 23303583
[x]
Attachment Details

Reading values from Web.Config

Asked by rgturner in .NET Framework 2.x, Programming for ASP.NET

Tags:

I have some values stored in my Web.Config and I would like to retrieve those values at runtime.
They look something like this:

      <appSettings>
            <add key="Value1" value="abc"/>
            <add key="Value2" value="xyz"/>
      </appSettings>

I have seen some code like the following, but it does not work.

      Dim WebConfig As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)

What am I doing wrong?Start Free Trial
[+][-]04.07.2008 at 09:48PM PDT, ID: 21302664

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 09:51PM PDT, ID: 21302672

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.x, Programming for ASP.NET
Tags: ASP.NET 2.0
Sign Up Now!
Solution Provided By: avnish_tanna
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.07.2008 at 10:32PM PDT, ID: 21302821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.07.2008 at 10:39PM PDT, ID: 21302839

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628