i'm trying to trigger on demand download of one combobox on selectedindex change (Client side Javascript ) event of other combobox.
e.g.
on selected index change event of country i want to populate states in other combobox using WebMethod
here what i tried,
//Country combobox event
function onSelectedIndexChanged(sender, eventArgs) {
var id = eventArgs._item.get_value();
var ddlstate = $get('ddlStateComboBoxID');
ddlstate.control._doLoadOnDemandFromWebService(id, { NumberOfItems: 0, Text: '', ID: id });
}
It calls WebMethod and get result properly at client side.
But it is giving javascript error on callback. It seems it is not initializing other methods that required before calling _doLoadOnDemandFromWebService.
so using which method i can start populating State Combo box?
Also I'm using Grid. and inside that i have 2 comboboxes on each row. So i can not use <%= State.ClientID %> in javascript.
So I'm creating JSon object having Country combo Id as Name and State combo id as its value(Not shown in above example).
Is there any other better way to define relation.
thanks & regards,
Shailesh
e.g.
on selected index change event of country i want to populate states in other combobox using WebMethod
here what i tried,
//Country combobox event
function onSelectedIndexChanged(sender, eventArgs) {
var id = eventArgs._item.get_value();
var ddlstate = $get('ddlStateComboBoxID');
ddlstate.control._doLoadOnDemandFromWebService(id, { NumberOfItems: 0, Text: '', ID: id });
}
It calls WebMethod and get result properly at client side.
But it is giving javascript error on callback. It seems it is not initializing other methods that required before calling _doLoadOnDemandFromWebService.
so using which method i can start populating State Combo box?
Also I'm using Grid. and inside that i have 2 comboboxes on each row. So i can not use <%= State.ClientID %> in javascript.
So I'm creating JSon object having Country combo Id as Name and State combo id as its value(Not shown in above example).
Is there any other better way to define relation.
thanks & regards,
Shailesh