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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjay ChauhanPosted Aug 26, 2009, 1:34 AM
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);