Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void btnSubmit_Click(object sender, EventArgs e)
    {
        XmlDocument xmldoc = new XmlDocument();
        xmldoc.Load(Server.MapPath("news.xml"));
        XmlElement parentelement = xmldoc.CreateElement("Comments");
        XmlElement name = xmldoc.CreateElement("Name");
        name.InnerText = txtName.Text;
        XmlElement Description = xmldoc.CreateElement("Description");
        Description.InnerText = txtComments.Text;
        XmlElement date = xmldoc.CreateElement("Date");
        date.InnerText = DateTime.Now.ToString();
        parentelement.AppendChild(name);
        parentelement.AppendChild(Description);
        parentelement.AppendChild(date);
        xmldoc.DocumentElement.AppendChild(parentelement);
        xmldoc.Save(Server.MapPath("news.xml"));
        Clear();
    }

hi this is my XML data list file & i want to delete xml element on delete comand plese help me...
Posted
Updated 5-Oct-12 0:45am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900