Point xmldoc.load to a root file when it is being called be a virtual directory tag within a subfolder

Posted on 2008-11-10
Last Modified: 2012-05-05
Hi, I have an IIS server with a universal web.config for connection strings.  i have older classic asp files I wrote a script for to parse the web.config file.  I want both the connection.asp and the web.config to sit on the root level.

I successfully connect to the connection .asp at the root level using this tag within the classic asp pages  <!--#include virtual="/ClientConnection.asp"-->

But when it reads this file, it will only connect to a web.config file within the folder, not at the root - this is the code that loads the web.config


Can I make this to force it to point to a root file?
Question by:theclassic
    LVL 4

    Expert Comment

    xmlDoc.Load(Request.ServerVariables("APPL_PHYSICAL_PATH") & "web.config")

    Server.Mappath means current folder..   As long as you left everything default in IIS, then the application physical path will be the root of the website.
    LVL 4

    Accepted Solution

    Here I setup an example..   Look how the APPL_PHYSICAL_PATH is the same, but the PATH_TRANSLATED is different..

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now