1
Answer

writing xml to a file.. overwriting previous data

Mohit  Juneja

Mohit Juneja

11y
1.7k
1
Whenever i am trying to execute this code .. it  overwrites my previous XML elements... 

 XmlDocument Doc = new XmlDocument();
            XmlDeclaration dec = Doc.CreateXmlDeclaration("1.0", null, null);
            Doc.AppendChild(dec);
            XmlElement DocRoot = Doc.CreateElement("Feedback");
            Doc.AppendChild(DocRoot);


            XmlNode server = Doc.CreateElement("Message");
            DocRoot.AppendChild(server);
            server.InnerText = this.TextBox1.Text;


            Doc.Save(Server.MapPath("mm.xml"));
Answers (1)