I have to write information from textboxes to XML file on click event. My sample code would look lik this.
XDocument xmlDoc = XDocument.Load(fileName);
xmlDoc.Element("Mediaplans").Add(new XElement("MediaPlan", new XElement("Media",TxtMedia.Text),
new XElement("Adtype", TxtAdtype.Text), new XElement("EmailId",TxtEmailId.Text)));
xmlDoc.Save(fileName).
What I want to know is how do we add attributes to elements with the above method? I am new to this field. any help appreciated.
Thanks, Kruthika