Users Pricing

forum

Home Forums Populate drop downlist with an xml file – MindStick

Populate drop downlist with an xml file

Anonymous User 2400 20 May 2013
Hi Developers,

I have two dropdownlist in my app country and state and i have to populate them through an xml file.
I have written the following code: 


ds = new DataSet();
                ds.ReadXml(Server.MapPath("~/country_state.xml"));
                LoadCountryDropdownList();

public void LoadCountryDropdownList()
            {
                ddlCountry.DataTextField = "name";
                ddlCountry.DataValueField = "country_Id";
                ddlCountry.DataSource = ds.Tables["country"];
                ddlCountry.DataBind();
                LoadStateDropdownList(ddlCountry.SelectedValue);
            }

private void LoadStateDropdownList(string country_Id)
        {
}

through this code i have achieved data reading from an xml file is done 
and i have also populate the country dropdownlist list
now i have to populate the state dropdownlist list on the basis of country dropdownlist.

Thanks in advance.

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md