views:

27

answers:

2

Hi,

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?


Problem solved: 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.

A: 

Remove the line:

CompMapping.DataBind();
onof
That doesn't change anything.
Antoine
Is it the user control loaded at run time with LoadControl()?
onof
No, it's added in the aspx in design mode.
Antoine
A: 

Question solved, see edits.

Antoine