Add two dropdown lists to your aspx page.
Call below function on page load:
public void LoadXML()
{
string myXMLfile = Server.MapPath("~/YourFile.xml");
DataSet ds = new DataSet();
try
{
dsStudent.ReadXml(myXMLfile);
DropDownList1.DataSource = ds;
DropDownList1.DataValueField = "Name";
DropDownList1.DataTextField = "Name";
DropDownList1.DataBind();
DropDownList2.DataSource = ds;
DropDownList2.DataValueField = "Name";
DropDownList2.DataTextField = "symbol";
DropDownList2.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
Add SlectedIndex change event to DropDownList1:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList2.Items.FindByValue(DropDownList1.SelectedValue).Selected = true;
}
Don't forget to mark useful responses as Answer if they helped you towards a solution.