I am trying to populate dropdownlist based on the selection of another dropdown list.

I am trying to populate dropdownlist based on the selection of another dropdown list.

Hi sir,
I am trying to populate dropdownlist based on the selection of another dropdown list. But it is not showing the mapping values. Please check it where  i am doing the mistake and this is my code.

<

script type ="text/javascript">

$(document).ready(

function () {

$(

'#drpCategory' ).change( function () {

var drpCategory = $( this ).val();

//$.getJSON('<%= ResolveUrl("~/Recommendation/GetCategoryId/")%>' + $("#drpCategory > option:selected").attr("value"), function (data) {

$.getJSON(

'<%= ResolveUrl("~/Recommendation/GetCategoryId/")%>' + drpCategory, function (data) {

mapids = data.mapids;

subcategoriesdesc = data.subcategoriesdesc;

debugger ;

var items = "" ;

if (subcategoriesdesc != null ) {

$.each(subcategoriesdesc,

function (i, SubCategoryCollection) {

debugger ;

items += "<option value='" + mapids + "'>" + SubCategoryCollection + "</option>";

});

}

else {

items =

"" ;

}
$('#drpSubCategory').html(items);

});

});

});
 
I am getting the mapped values in the items but in the view page dropdown is not showing any values.