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

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
 
A

Anthony Jones

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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top