I have a form which consists a list of dropdown boxes, the code below using <select> works, but when I try to use DropDownList, it doesn't render properly.
<form asp-action="Confirm">
<div class="form-horizontal">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="BlobName" />
<table class="table">
<thead>
<tr>
<th>
Unknown Contacts
</th>
<th>
Solution
</th>
</tr>
</thead>
<tbody>
@for (int i=0; i < Model.ContactConfirmation.Count;i++)
{
<tr>
<td>
<input type="text" name="confirmation.ContactConfirmation[@i].UnmatchContactName" asp-for="@Model.ContactConfirmation[i].UnmatchContactName" class="form-control" readonly />
</td>
<td>
<select name="confirmation.ContactConfirmation[@i].NewContactName" asp-for="@Model.ContactConfirmation[i].NewContactName" asp-items="@ViewBag.contacts"></select>
</td>
</tr>
}
</tbody>
</table>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Confirm" class="btn btn-default" />
</div>
</div>
</div>
</form>