Itβs already said here
function bindDdl() {
try {
var ddl = document.getElementById('ddl1');
var x = PageMethods.GetData('', onsuccess, onfail);
}
catch (e) {
alert(e);
}
}
function onsuccess(result) {
try {
var ddl = document.getElementById('ddl1');
var count= ddl.options.length;
while (ddl.options.length > 0) {
ddl.options.remove(0);
}
for (var i = 0; i < result.length-1; i=i+2) {
var opt = document.createElement("option");
opt.text = result[i];
opt.value = result[i+1];
ddl.options.add(opt);
}
}
catch (e) {
alert(e);
}
}
You may have an onchange event like this
Look at here
So you can reload it, but
NOTE. - If you bind server controls on the client side, it will always give you an error Instead, bind them on the server side and add values ββon the client side, which is preferable
source
share