How do I add modelstate error to a list
You can quite simply add directly into ModelState
as key/value pairs:
ModelState.AddModelError("error", "Serial is invalid");
and then in your view: @Html.ValidationMessage("error")
.
You can quite simply add directly into ModelState
as key/value pairs:
ModelState.AddModelError("error", "Serial is invalid");
and then in your view: @Html.ValidationMessage("error")
.