I'm getting JSON back in this format from my C# webmethod:
{"d":["ADAMS CITY","BOULDER","ANTON","ARBOLES"]}
I now have a asp.net dropdown. Well, it renders as a html dropdown with #city
id.
I'm getting a success alert on my AJAX request. How can I populate these results into my #city dropdown?
Tried this:
success:
function (data) {
var values = eval(data.d);
var ddl = $("#parkCity");
$('option', ddl).remove();
ddl.html(data);
alert("Cities loaded");
},
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…