Link to home
Start Free TrialLog in
Avatar of theclassic
theclassicFlag for United States of America

asked on

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

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

xmlDoc.Load(Server.Mappath("web.config"))

Can I make this to force it to point to a root file?
Avatar of Chizl
Chizl
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of Chizl
Chizl
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial