ASP.NET WebForms: SelectedIndexChanged not firing in user control

40 Views Asked by At

I have an aspx page, that shows a user control with a list of element as a dialog.

...
<div style="display: none" runat="server" class="cssForDialog">
    <uc:ucList runat="server" ID="ucList" />
</div>
....

Then the ucList control, uses another user control for create a user element, always as a dialog:

...
<div style="display: none" class="cssForDialog" runat="server">
    <uc:ucNewElement runat="server" ID="ucNewElement"/>
</div>
...
<asp:Button runat="server" ID="btnShowCreateDialog" OnClick="btnShowCreateDialog_Click" Text="Show" />

The ucNewElement have a drop down list

...
<asp:DropDownList ID="ddlElementTypes" runat="server" AutoPostBack="true"></asp:DropDownList>
...

With the SelectedIndexChanged registered

...
Private Sub ddlElementTypes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlElementTypes.SelectedIndexChanged
  Do something
End Sub
...

The problem is that the SelectedIndexChanged is not firing.

Any suggestions?

Thanks in advance.

1

There are 1 best solutions below

0
On

Your dropdown does not have the event handler.

onselectedindexchanged="ddlElementTypes_SelectedIndexChanged"