Return Data and View in JsonResult

0

I put them in context, I'm working with C # MVC architecture, when making POST of a Create, defined as follows:

 [HttpPost]
 public JsonResult Create(List<Modelo> registros)
 {...

I must return a JsonResult() in which I must return the data (Data) and in turn reload the View in which I am doing this Post with the data already loaded.

I have made the following Json:

return new JsonResult() { Data = new { Ok = true } };
}

The problem is that I do not know how to return the current View (Post "Create") in this same return Json .

Greetings, I am available for any questions about the question.

    
asked by byte96 16.10.2018 в 21:27
source

1 answer

0

If you want to send a form to a View Create you have to create the controller

[HTTPGet] public ActionResult Create()..

and use what the ajax call returns from that view, JsonResult only returns json

    
answered by 16.10.2018 в 21:58