I am using the following EditorTemplate:
<div class="form-group">
@Html.LabelFor(m => m, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
When attempting to save the form with a deliberate error, the page refreshes and correctly shows the validation error but the label completely disappears. It is not hidden it is completely gone from the html source.
Here is my EditorFor:
@Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })
Is this a bug, or does anyone know what might be causing this?
This problem has been fixed with the latest asp.net core.
See here: