| Author: varun 05 Sep 2008 | Member Level: Gold | Rating: Points: 3 |
Steps:
1. Add reference to System.XML 2. Use the followingmethod: ReplaceChild :Replaces the referenced child with a new node. If the new node is already in the tree, it is removed first.
This will replace the existing node with the new one. For syntax, check the google.
|
| Author: vipul 05 Sep 2008 | Member Level: Diamond | Rating: Points: 3 |
hi, used this way XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(Server.MapPath("XMLFile.xml"));
string str = xmlDoc.InnerXml; str = str.Replace("Menu", "Menu1"); xmlDoc.LoadXml(str); xmlDoc.Save(Server.MapPath("XMLFile.xml"));
vipul, http://dongavipul.blogspot.com
|