mrbean
Posts: 1
|
Posted: 06/09/2016, 10:52 PM |
|
Hi there could you help me.
I've problem Asp-validation-summary in view shows errors added via ModelState.AddModelError, but don't show any model validation errors ("The User field is required."). I'm using Microsoft ASP.NET MVC Core 1.0. RC2 final hosted in asphostportal.com
//<div asp-validation-summary="ModelOnly" class="text-danger"></div> in view ModelState.AddModelError(string.Empty, "This error shows up in validation-summary"); ViewBag.HeaderMessage = "Error: " + string.Join(" - ", ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage))
|