Passing TextBox values to XML
What is the way of passing TextBox values to an XML document
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
TulasiRank #2,544 · 549 reputationPosted Oct 23, 2011, 8:41 PM EDT
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Server.MapPath(@"App_Data\Myxml.xml"));
//Create a new node
XmlElement newelement = xmldoc.CreateElement("Employee");
XmlElement xmlName = xmldoc.CreateElement("Name");
xmlAuthor.xmlName = TextBox1.Text.Trim();
newelement.AppendChild(xmlName );
xmldoc.DocumentElement.AppendChild(newelement);
Chk the below link
http://www.aspnettutorials.com/tutorials/database/XML-Csharp.aspx
Please mark the answer as Accepted if it helps you.
Sam HobbsRank #107 · 20.5K reputationPosted Oct 24, 2011, 9:10 AM EDT