I have a drop downlist with xml files. when i select 1 from there i need to populate another dropdown list with just the nodes..
my c# code that populates the 1st dropdown with the xml files
protected void Page_Load(object sender, EventArgs e)
{
DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("/Xmlscripts"));
lblFolderLocation.Text = dirInfo.ToString();
FileInfo[] fileList = dirInfo.GetFiles();
foreach (FileInfo fileInfo in fileList)
{
dropdownlist1.Items.Add(new ListItem(fileInfo.Name, fileInfo.Name));
}
}
I need help populating the second dropdown list with the nodes of the xml file when selected
Example of xml file below
<Script>
<greeting> // need to display in second drop box
<data>hi how you</data>
</greeting>
<verification> // need to display in second drop box
<data> can i confirm it is Mike</data>
</verification>
<dropOf> // need to display in second drop box
<data>when can i drop off?</data>
</dropOf>
<infoRequired> // need to display in second drop box
<data>need the proof of payment</data>
</infoRequired>
<example> // need to display in second drop box
<data> till slip</data>
</example>
<end> // need to display in second drop box
<data>Thank you</data>
</end>
</Script>
I want to add just the greeting, verification, dropOf, infoRequired, example, and end to the second dropdown list so when i click on one of them it will be able to display in a textbox.