@page
@model ListBindComplex.Pages.EditModel
@{
}

<div class="text-center">
    <h1 class="display-4">Edit Prospective Customers</h1>
</div>

<form class="form-horizontal" method="post">
    <table class="table table-striped">
        <tr>
            <th>Id</th>
            <th>Name</th>
            <th>Mail</th>
        </tr>
        @foreach (var pc in Model.ProspCustomers) {
            <input type="hidden" name="ProspCustomers.Index" value="@pc.Id"/>
            <input type="hidden" name="ProspCustomers[@pc.Id].Id" value="@pc.Id" />
            <tr>
                <td> <label>@pc.Id</label> </td>
                <td> <input name="ProspCustomers[@pc.Id].Name" value="@pc.Name" /> </td>
                <td> <input name="ProspCustomers[@pc.Id].Mail" value="@pc.Mail" /> </td>
            </tr>
        }
    </table>
    <div class="form-group">
        <input type="submit" value="Update" class="btn btn-primary" />
    </div>
</form>