문제

I have this DropDownList bound to a XmlDataSource, but the XPath must depend on another input (another DropDownList). I modify the XPath and rebind inside the parent DDL's SelectedIndexChanged, but the page does not refresh. What should I do to display the update?

protected void ProductDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
    CompMapping.XPath = "//couple[@product='" + ProductDropDownList.SelectedValue + "']";
    CompMapping.DataBind();
    ComponentDropDown.DataBind();
}

ComponentDropDown is set to AutoPostBack=True, but that's not enough. Any idea? Could it be related to the fact both DropDownLists are in a UserControl?

도움이 되었습니까?

해결책 2

The issue must be linked to the fact that it's a user control, since linking the dropdowns outside it has no problem. Realizing I don't absolutely need these to be in a user control, I just moved them outside. That don't really solves the issue, but at least it's not my concern anymore.

다른 팁

Remove the line:

CompMapping.DataBind();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top