Accessing web.config from a classic asp program


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?


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

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



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


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