public JsonResult GetExamCodeByCourseId(int id) { var dataList = examManager.GetExamCodeById(id); return(Json(dataList.Select(c => new { c.Id, c.ExamCode }), JsonRequestBehavior.AllowGet)); }