本文介绍了SelectedIndexChanged方法不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void ClassDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
if (ClassDropDownList.SelectedValue.Selected)
{
string myXMLfile = Server.MapPath("~/OrgList.xml");
DataSet NAME_DATASET = new DataSet();
NAME_DATASET.ReadXml(myXMLfile);
NameDropDownList.DataSource = NAME_DATASET;
NameDropDownList.DataTextField = "NAME";
NameDropDownList.DataValueField = "ID";
NameDropDownList.DataBind();
}
}
我已经有一个类下拉列表.当在类下拉列表中选择一个项目时,我希望填充名称下拉列表.为什么不人口稠密.
I already have a class dropdownlist .when an item is selected in the class dropdown list i want the name dropdownlist to be populated. why is not popuating . what else should be done can i get the c# code please.
推荐答案
这篇关于SelectedIndexChanged方法不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!