Accessing web.config from a classic asp program

Question!

I have a application in which there is a web.config file. I have to use a classic asp file and I need to access web.config configuration sections with classic asp file.

How can I access the web.config file from a classic asp program?

I find some resouces which was recommending to use a dom parser and access the values with a parser.

Is there a better way?

ex:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <appSettings>
    <add key="mykey" value="myvalue"/>

  </appSettings>

</configuration>

I wanna be able to read this config file from a classic asp file. Classic asp file uses jscript.



Answers

You should be able to use

MyVar = WebConfigurationManager.AppSettings("myKey")

In the code behind to read that value.

By : Tony318


You could write a .NET class library that loads the XML configuration and exposes the needed properties to COM.



This video can help you solving your question :)
By: admin