public JsonResult ReservasPorEspacioSolicitado(FormCollection collection) { ReservaDAL bd = new ReservaDAL(); int espacio = int.Parse(collection["EC_ID_ESPACIO"].ToString()); var model = bd.ObtenerVistaReservasPorEspacioSolicitado(espacio); if (model != null) { var result = new { Success = true, Message = "Succes Message", model }; return(Json(result, JsonRequestBehavior.AllowGet)); } else { var result = new { Success = false, Message = "Error Message" }; return(Json(result, JsonRequestBehavior.AllowGet)); } }