public ActionResult getCourseGroups(int pIDCurso, int pSede) { if (HttpContext.Request.IsAjaxRequest()) { var json = ""; var vPeriod = Request.Cookies["Periodo"].Value; var vIDPeriod = db.Periods.Find(int.Parse(vPeriod)).ID; var sp_getCourseGroups = db.SP_GroupCourse(pIDCurso, pSede, vIDPeriod).ToList(); json = JsonConvert.SerializeObject(sp_getCourseGroups); return(Content(json)); } return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); }