I have a ViewModel and within there are a few lists. I want to show the following properties:
public string Status { get; set; }
public DateTime Applicationdate { get; set; }
public DateTime Submitdate { get; set; }
public Boolean CustomerAgreementBoolean { get; set; }
public DateTime CustomerAgreementBooleanDate { get; set; }
public string MultiannualContract { get; set; }
They are part of a bigger model. It half works when I do this in the view:
@foreach (var offeritem in Model.Offermodel)
{
<div class="col-md-3 mb-3">
@Html.LabelFor(model => model.Offermodel)
@Html.EditorFor(x => offeritem.Applicationdate, new {
htmlAttributes = new { @class = "form-control", required =
"required" } })
@Html.ValidationMessageFor(x => offeritem.Applicationdate, "",
new { @class = "text-danger" })
</div>
}
The names of the label and editor become: Offeritem.Applicationdate
instead of "Applicationdate"
Is there any way to get the correct names to show?