Hi i have two WebDropDown control in my form. one is state and another one is city. i selected state means corresponding city loaded to city WebDropDown using javascript. i wrote a code but i got error like "Microsoft JScript runtime error: Unable to get value of the property '_callbackManager': object is null or undefined"
My Code is :
function LoadDropDown() { var ddlState = $find('ddlState'); var Tamilnadu = new Array('--Select--', 'Salem', 'Coimbatore', 'Karur'); var Kerala = new Array('--Select--', 'Kochin', 'Palakad', 'Kollam'); var ddlCity = $find('ddlCity'); switch (ddlState.get_currentValue()) { case 'Tamilnadu': for (var i = 0; i < Tamilnadu.length; i++) { var item = ddlCity.get_items().createItem(); item.set_text(Tamilnadu[i].toString()); item.set_value(i); ddlCity.get_items().add(item); ddlCity.set_selectedItemIndex(0) } break; case 'Kerala': for (var i = 0; i < Kerala.length; i++) { var item = ddlCity.get_items().createItem(); item.set_text(Kerala[i]); item.set_value(i); ddlCity.get_items().add(item); } break; default: ddlCity.options.length = 0; break; } }
Kindly help me someone please.
Thanks.
Hello Murali,
Thank you for contacting Infragistics!
I recommend you see the following forum thread:
http://es.infragistics.com/community/forums/p/78574/398781.aspx#398781
As stated in the forum thread you can use that code to add one item at a time as each item added caused an ajax postback. If you wanted to add multiple items you should do this on the server side. If you are looking to populate the dropdown upon selection from previous dropdown I recommend you look into cascading:
http://es.infragistics.com/samples/aspnet/drop-down/cascade
http://es.infragistics.com/samples/aspnet/drop-down/cascade-alternative