Fire SelectedIndexChanged event on button click for dropdown
-
17-01-2021 - |
문제
i change dropdown list with button click like this:
ddl.selectedIndex+=1
my ddl has a SelectedIndexChanged event which is not firing if index changed through button. Is it a normal behavior? Should I create separate method and call it right after the ddl.selectedIndex+=1
or there's a better way?
해결책
I'm assuming you're using ASP.NET? If so, setting AutoPostBack
may help:
<asp:DropDownList ID="ddl" runat="server" AutoPostBack="true">
</asp:DropDownList>
제휴하지 않습니다 StackOverflow