Passing TextBox values to XML
What is the way of passing TextBox values to an XML document
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.
Sam HobbsPosted Oct 24, 2011, 1:10 PM
TulasiPosted Oct 24, 2011, 12:41 AM
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.