Can't create a new xml file on discountasp.net web server programmatically

Discussion in 'ASP.NET 2.0' started by clint, Jan 5, 2008.

  1. I am trying use the following in an asp.net web page ...



    XmlTextWriter xmlWriter = new XmlTextWriter(@"e:\web\klyghntcom0\htdocs\test.xml", System.Text.Encoding.UTF8);
    While debugging, I get the following error "Could not find a part of the path 'e:\web\klyghntcom0\htdocs\test.xml"

    The Server Path I am using is what I see in my control panel.

    Does anyone have suggestions on how to make this work?

    Thanks,
    Clint
     
  2. Try this:
    XmlTextWriter xmlWriter = new XmlTextWriter(Server.MapPath("test.xml"), null);
     

Share This Page