Hi all, I am experiencing a strange issue with my program: My program needs a simple data storage so I used a xml file. first, I read the data upon page opening, when user enters/modifies the form it saves the data back into the xml file.
Here is the pseudo code:
public partial class _Default : System.Web.UI.Page{
public XmlDocument doc; //xml document
protected void Page_Load(args)
{
doc = new XmlDocument();
doc.Load(path);
/*reading data from xml doc*/
}
protected void Button1_Click(args){ //When button clicks
/*appends form data to xml doc*/
doc.Save(path);
}
}
The symptom: When I am running on my local machine it runs perfectly fine,
However, when I run it on my web host,
the Save process seemed to terminate before the file is finished writing.
The point it stops is completely arbitrary...
here is an example of corrupted xml:
<root>
<a attr="attribute 1"></a>
<a attr="attribute 2"></a>
<a attr="attribute 3"></a>
<a attr="attribute 4"></a>
<a at <--- file terminates here, randomly, no exception thrown.
Any ideas what might have caused the problem?
View Complete Post