Use XML to Populate Combo Box

admin

Administrator
Staff member
Hi,

I am using ASP.NET with VB.NET and XML.

I have the following XML file and would like to populate a drop-down list control (System.Web.UI.WebControls.DropDownList). I would like the <page> elements to be placed as the drop-down list items' text and the <url> element to become the drop-down list items' value.

<?xml version="1.0" encoding="ISO-8859-1"?>
<jumplist>
<jumpitem>
<page>Main Page</page>
<url></url>
</jumpitem>
<jumpitem>
<page>--------------</page>
<url></url>
</jumpitem>
<jumpitem>
<page>Forums Home</page>
<url>forum/forums.aspx</url>
</jumpitem>
<jumpitem>
<page>--------------</page>
<url></url>
</jumpitem>
<jumpitem>
<page>Gallery</page>
<url>gallery.aspx</url>
</jumpitem>
</jumplist>

Would somebody please be able to show me how to do this?

Regards,
Lea Hayes
 
Back
Top