public JsonResult SelectPL(string Discipline_ID) { string Code = string.Empty, Message = string.Empty; List <mProgrammeLevel> _list = new List <mProgrammeLevel>(); try { //ProgrammeLevel_Repository _objRepo = new ProgrammeLevel_Repository(); ChoiceFillingRepository _objRepo = new ChoiceFillingRepository(); DataSet _ds = _objRepo.SELECT_PROGRAMELEVEL_FROM_DISCIPLINE_FOR_CH(Session["studentid"].ToString(), Session["ApplicationNo"].ToString(), Discipline_ID, "ChoiceFilling"); if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { foreach (DataRow _dr in _ds.Tables[0].Rows) { _list.Add(new mProgrammeLevel { ProgramLevel_Id = _dr["ProgramLevel_Id"].ToString(), ProgramLevel = _dr["ProgramLevel"].ToString() }); } } } } catch (NullReferenceException) { Code = "error"; Message = "Your session has been expired. Kindly refresh and try again."; } catch (Exception) { Code = "error"; Message = "Error from server side. Kindly refresh and try again."; } return(Json(new { List = _list, c = Code, m = Message }, JsonRequestBehavior.AllowGet )); }