BlipDrop icon indicating copy to clipboard operation
BlipDrop copied to clipboard

Mistake in Create.cshtml

Open jaszczykj opened this issue 5 years ago • 0 comments

You have

@Html.EditorFor(model => model.CustomerName, new { htmlAttributes = new { @class = "form-control", @autofocus = "autofocus" } })
@Html.ValidationMessageFor(model => model.CustomerId, "", new { @class = "text-danger" })

but it shoul be

@Html.EditorFor(model => model.CustomerName, new { htmlAttributes = new { @class = "form-control", @autofocus = "autofocus" } })
@Html.ValidationMessageFor(model => model.CustomerName, "", new { @class = "text-danger" })

change model => model.CustomerId to model => model.CustomerName in CustomerName field

Without this change you don't see error message when you leave empty filed: CustomerName

jaszczykj avatar Jun 25 '19 09:06 jaszczykj