I have gone mad trying to bind the json string to the dropdown. Please can somebody help??
My dropdownlist id is 'ddlteams'
My json string is in this form :
"{"TeamList" : [{"teamid" : "1","teamname" : "Barcelona"}]}"
so first i convert into an object.
var objdata = $.parseJSON(jsonObj.d);
Then i add my code given below.
$('#ddlteams').children().remove();
I am having problem with the below code. Please can somebody help me with this
$.each(objdata, function(i, val) {
$('#ddlteams').append('<option value="' + objdata.TeamList[0].teamid + '">' + TeamList[0].teamname + '</option>');
});