In My project ,i have a folder with Details.aspx page. and i have Details.xml file outside of the folder. Now i want to get file location of Details.xml to Details.aspx.cs page. i have tried different ways, but i am not getting file location.
Details.aspx.cs :
private void GenerateXMLFile()
{
try
{
DataSet dsJobsDetails = new DataSet();
dsJobsDetails = GetJobDetails();
string fileLoc = Server.MapPath("Details.xml");
if (File.Exists(fileLoc))
{
try
{
dsJobsDetails.WriteXml(fileLoc);
Response.Redirect("Details.xml");
}
catch { }
}
}
catch { }
}
Please tell me how to get file location. Thank you..