我将此 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 中的事实有关吗?