|
-
March 6th, 2011, 10:30 AM
#1
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|