Adding xml to a drowdown, working but I need help getting it right.
ok my xml file currently looks like this...
<links>
<link url="http://www.google.co.uk/">Google</link>
</links>
and I am using the following code in my C# application, to add the drop down.
XmlDocument LinkLoader = new XmlDocument();
LinkLoader.Load(@"C:\links.xml");
XmlNodeList List1 = LinkLoader.SelectNodes("links/link");
foreach (XmlNode link in List1)
{
cboURL.Items.Add(link.InnerText);
}
This causes the combo box to display all of the titles, which is perfect, but I want to associate the titles with the first half, which is the url, so that, if clicked, the user will be taken there.
How do I "get" the url on the left? and how can I associate .InnerText with that?