Click to See Complete Forum and Search --> : Probably embarassingly easy...


High_D
September 29th, 2006, 12:19 PM
First time trying ASP.net. I made a class in the App_Code folder, and am trying to load an XML document.

XmlDocument xmldoc = new XMLDocument();
xmldoc.Load("Settings.xml");

Gives a filenot found error. Seems to be looking in 'C:\Program Files\Microsoft Visual Studio 2005\Common7\IDE\Settings.xml'. instead of the folder where the default.aspx is.
In a normal windows app i'd just put Application.StartupPath in front of it, but what's the equivalent in ASP...or am I not going about this the right way.

Anything would be great,
Thanks

Eli Gassert
September 29th, 2006, 01:14 PM
Use SErver.MapPath

.Load(Server.MapPath("Settings.xml"))