When my ASP.NET site uses documents (e.g. XML), I normally load the document as follows:
Server.MapPath("~\Documents\MyDocument.xml")
However, I would like to move the Documents folder out of the website folder so that it is now a sibling of the website folder. This will make maintaining the documents considerably easier.
However, rewriting the document load code as follows:
Server.MapPath("../../Documents/MyDocument.xml")
results in a complaint from ASP.NET that it cannot 'exit above the top directory'.
So can anyone suggest how I can relatively specify the location of a folder outside the website folder? I really don't want to specify absolute paths for the obvious deployment reasons.
Thanks
David