Beispiel #1
0
        private JsonResult GetBookFormBody(BookFormDto bookFormDto)
        {
            var bookFormReferenceDto = bookPilotageService.GetBookFormReferenceDto();

            ViewBag.Authors = bookFormReferenceDto.Authors;

            var html = PartialView("views/pilotage/books/_Modal_Book_Body.cshtml", bookFormDto).Render(this.HttpContext);

            Response.StatusCode = ModelState.IsValid ? (int)HttpStatusCode.OK : (int)HttpStatusCode.BadRequest;
            return(Json(html));
        }
Beispiel #2
0
        private JsonResult GetBookFormBody(BookFormDto bookFormDto)
        {
            var bookFormReferenceDto = bookPilotageService.GetBookFormReferenceDto();

            ViewBag.Authors = bookFormReferenceDto.Authors;

            var view         = ViewRenderer.RenderPartialView("_Modal_Book_Body", bookFormDto, this.ControllerContext);
            var jsonResponse = new JsonResponse(this.ModelState.IsValid, null, view);

            return(Json(jsonResponse, JsonRequestBehavior.AllowGet));
        }