Wednesday 5 June 2019

ASP NET Fix Drop Down List Selected Index Changed not executed

Watch this example on YouTube


To fix it replace

    <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
        <asp:ListItem> Test 1</asp:ListItem>
        <asp:ListItem> Test 2</asp:ListItem>
    </asp:DropDownList>

wtih

    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
        <asp:ListItem> Test 1</asp:ListItem>
        <asp:ListItem> Test 2</asp:ListItem>
    </asp:DropDownList>

No comments:

Post a Comment