0
My application has a View Create which is opened through a modal and the Controller which was a Actionresult became a Jsonresult then return Json after the request [Httppost].
The [Required] Field Dataannotations work perfectly.
Except that in this change some validations of my old configuration have not worked anymore, being it mandatory.
These messages were captured by:
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
How do I get Validationsummary to capture the message that is sent via Json
Examples of the return sent by my Controller Create.
return Json(new { resultado = true, mensagem = "Cadastro realizado com sucesso!" });
This will never work because the view is no longer loaded after the request. You will have to put this "Summary" manually after receiving the response from the server.
– Jéf Bueno
It’s really hit me today before I saw your answer, and you came to confirm, so thanks. What I will do is use the toastr for my messages, even if in some moments I have more than one warning message.
– Cyberlacs