0

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?

Jeff Atwood
  • 63,320
  • 48
  • 150
  • 153
Antoine
  • 5,055
  • 11
  • 54
  • 82

2 Answers2

0

Remove the line:

CompMapping.DataBind();
onof
  • 17,167
  • 7
  • 49
  • 85
0

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.

Jeff Atwood
  • 63,320
  • 48
  • 150
  • 153
Antoine
  • 5,055
  • 11
  • 54
  • 82