user2316046
user2316046

Reputation: 29

Setting the file path for an xml file

I'm making a project on visual web developer 2010 in c# and asp.net and I want to save the uniquely named xml files that are created into the xml folder that exists within the main folder. At the minute the xml files (which are generated from user input in a web form) save into the main folder and I can't seem to get them to save to the xml folder.

string xmlPath = MapPath(timeStamp + Company_Name.Text + ".xml");
//There's just some code here setting up the xml nodes.
doc.Save(xmlPath);

Upvotes: 1

Views: 474

Answers (1)

Patrick D'Souza
Patrick D'Souza

Reputation: 3573

string xmlPath =MapPath("~/xml/" + timeStamp + Company_Name.Text + ".xml");
//There's just some code here setting up the xml nodes.
doc.Save(xmlPath);

Upvotes: 1

Related Questions