Based on the information you provided I would make it like this
[HttpPost]
public JsonResult GetMonths(int YearId)
{
CCIRepository _repository = CCIRepository.CreateRepository();
List<MonthListClass> list = new List<MonthListClass>();
list = _repository.GetMonthFromImportDate(YearId);
return Json(list);
}
and in the script
type: "POST",
url: '@Url.Action("GetMonths","AirtelManagement")',
data: JSON.stringify({ YearId: $("#Yearitems").val() }),
datatype: "Json",
success: function (data) {
$("#MonthItems").html("");
$.each(data, function (index, item) {
debugger;
$("#MonthItems").append(new Option(item.MonthName, item.MonthSelectedId));
});
//$("#MonthItems").html(items);
},
Try it