My Xml page looks like this as follows:
In this i want to add another value in the name attribute as
how to perform this using C#.net.please help me
Thanks in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjay Chauhan55 reputationPosted Aug 25, 2009, 9:34 PM EDT
By using this way u can modify your xml
string FileName = MapPath( "/PageTitle.xml");
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(FileName);
XmlNodeList nodeList = xmlDoc.SelectNodes("/PageTitle/Page[@ID=" + id.ToString() + "]");
// update Description
nodeList[0].ChildNodes[1].InnerText = "Any modified Text";
xmlDoc.Save(FileName);