public JsonResult ReservasPorEspacio(FormCollection collection) { ReservaDAL bd = new ReservaDAL(); int espacio = int.Parse(collection["EC_ID_ESPACIO"].ToString()); var model = bd.ObtenerVistaReservasPorEspacio(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)); } }