Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@model List<ModelListBinding.Models.Person>
<form asp-action="Save" method="post" role="form">
<table>
<thead>
<tr>
<th><label asp-for="@Model[0].FirstName" class="control-label"></label></th>
<th><label asp-for="@Model[0].LastName" class="control-label"></label></th>
<th><label asp-for="@Model[0].Birthday" class="control-label"></label></th>
<th><label asp-for="@Model[0].IsActive" class="control-label"></label></th>
</tr>
</thead>
@for (int i = 0; i < Model.Count; i++)
{
<tr>
<td>
<input asp-for="@Model[i].id" type="hidden" />
<input asp-for="@Model[i].FirstName" class="form-control" />
</td>
<td>
<input asp-for="@Model[i].LastName" class="form-control" />
</td>
<td>
<input asp-for="@Model[i].Birthday" class="form-control" />
</td>
<td>
<label class="form-check-label">
<input class="form-check-input" asp-for="@Model[i].IsActive" />
</label>
</td>
</tr>
}
</table>
<input type="submit" value="Save" class="btn btn-default" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.