Exemplo n.º 1
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <MDSearch> list = mss.GetAllCity(DropDownList1.SelectedValue);

            DataTable dt = ListToDataTable(list);

            DropDownList2.Items.Clear();
            DropDownList2.Items.Add(new ListItem("请选择城市"));
            foreach (DataRow dr in dt.Rows)
            {
                DropDownList2.Items.Add(new ListItem(dr["City"].ToString()));
            }
            DropDownList2_SelectedIndexChanged(null, null);
        }