There is a small form:
@model IEnumerable<Store.Web.ViewModels.CustomerViewModel> <h2>Create Customer</h2> <div class="row"> <div class="col-md-4"> <form asp-action="Create" asp-controller="Customer"> <div class="form-group"> <label asp-for="Name" class="control-label"></label> <input type="text" asp-for="Name" class="form-control" /> </div> <div class="form-group"> <input type="submit" value="Create" class="btn btn-primary" /> </div> </form> </div> </div>
How to correctly identify the Name in the specified lable?
label asp-for = "Name"
but an error occurs:
It is not necessary to define a n name acce '' no no no
@model Store.Web.ViewModels.CustomerViewModel
- WebMordaIEnumerable' does not contain a definition for 'Name'
errorIEnumerable' does not contain a definition for 'Name'
. The problem is not in tag helpers, but in your model. If you want to work with a list, you need to go through it with a cycle@foreach (var item in Model){ }
- WebMorda