我将这个DropDownList绑定到一个XmlDataSource,但是XPath必须依赖于另一个输入(另一个DropDownList)。我修改了XPath并在父DDL的SelectedIndexChanged中重新绑定,但是页面没有刷新。我应该怎么做才能显示更新?
protected void ProductDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
CompMapping.XPath = "//couple[@product='" + ProductDropDownList.SelectedValue + "']";
CompMapping.DataBind();
ComponentDropDown.DataBind();
}ComponentDropDown设置为AutoPostBack=True,但这还不够。有什么想法吗?这可能与两个DropDownLists都在一个UserControl中的事实有关吗?
发布于 2010-07-12 21:44:50
这个问题一定是因为它是一个用户控件,因为在它外部链接下拉菜单是没有问题的。意识到我并不是绝对需要把它们放在用户控件中,我就把它们移到了外面。这并不能真正解决问题,但至少这不再是我关心的问题了。
发布于 2010-07-07 23:42:10
删除该行:
CompMapping.DataBind();https://stackoverflow.com/questions/3196345
复制相似问题