Good afternoon from quarantine (I'm in Italy)
I've to modify an old project that include some cascadingdropdown. My client want to use a textbox for better choose items.
There are two jquery option chosen and select2.
But my problem is that twice don't update the child dropdown, they update the original (hidden) dropdown and change event are risen but the child won't charge data (imagine a country, state scenario).
Looks like that there is a different behaviour between manualy change the dropdown and progammatically.
I'm wondering if there is a method to force the update of the child dropdown.
This is my code:
PS: the two drop are inside a FormView and are binding previous choice.
PS2: I use setTimeout before set chosen to wait for completely fill of the first dop
Thank you
Marco
<form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" AsyncPostBackTimeout="2000" /><div><asp:DropDownList runat="server" ID="regione" CssClass="drop chosen" /><ajaxToolkit:CascadingDropDown ID="ajaxRegione" BehaviorID="myCDERegione" runat="server" TargetControlID="regione" Category="regione" PromptText="Scegliere...." LoadingText="Loading..." ServicePath="~/service/fillDll.asmx" ServiceMethod="GetRegione" SelectedValue='<%#Bind("ID_regione")%>' /><br /><br /><asp:DropDownList runat="server" ID="citta" CssClass="drop" /><ajaxToolkit:CascadingDropDown ID="ajaxCitta" BehaviorID="myCDECitta" runat="server" TargetControlID="citta" Category="citta" ParentControlID="regione" PromptText="Scegliere...." LoadingText="Loading..." ServicePath="~/service/fillDll.asmx" ServiceMethod="GetCitta" SelectedValue='<%#Bind("ID_citta")%>' /></div></form><script type="text/javascript">
setTimeout(function(){ $('.chosen').chosen(); }, 1000);$('<%="#"+ regione.ClientID %>').on('change', function (e) {
alert(e);
})</script>