How to fill the data into the textboxes from an xml file?

Tripati_tutu
Posted by Tripati_tutu under ASP.NET category on | Points: 40 | Views : 3700
Below is the sample code
private void SearchXmlData(int selectedIndex)
{
XmlDocument docXml = new XmlDocument();
docXml.Load(Server.MapPath(@"App_Data\TestXmlFile.xml"));
XmlNodeList list = docXml.DocumentElement.ChildNodes;
XmlNode node = list.Item(selectedIndex);
this.txtUser.Text = node["UserName"].InnerText;
this.txtQuestion.Text = node["Question"].InnerText;
this.txtSolution.Text = node["Solution"].InnerText;
}

Comments or Responses

Login to post response