Files
NTBug/web/Helpdesk.Web/Views/Shared/_FormErrors.cshtml
T

22 lines
605 B
Plaintext
Raw Normal View History

@* Chyby, které nepatří ke konkrétnímu poli (např. „Neplatný e-mail nebo heslo.“). *@
@{
var errors = ViewData.ModelState.TryGetValue(string.Empty, out var entry) ? entry.Errors : null;
}
@if (errors is { Count: > 0 })
{
<div class="alert alert-danger" role="alert">
@if (errors.Count == 1)
{
@errors[0].ErrorMessage
}
else
{
<ul class="mb-0 ps-3">
@foreach (var error in errors)
{
<li>@error.ErrorMessage</li>
}
</ul>
}
</div>
}