Adding,Deleting and modifying the xml file using asp.nettree view control

  • Thread starter Thread starter gugan gg
  • Start date Start date
G

gugan gg

In my project i have a requirement of using the xml file to create the tree view control. I have problem in deleting the elements of the xml file.
can anyone suggest a solution for this.

Thanks in advance!!!

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
In my project i have a requirement of using the xml file to create the
tree view control. I have problem in deleting the elements of the xml
file.
can anyone suggest a solution for this.

Use System.Xml.XmlDocument. Load file into object with Load method.

Use SelectSingleNode with XPath to find the element you wish to delete.

XmlNode elemToDelete = dom.SelectSingleNode("xpath here");
elemToDelete.ParentNode.RemoveChild(elemToDelete);
 
Back
Top