Create MVC 5 Combo Box from CRM Entities?
- by SpaceCowboy74
I am working on an MVC 5 App that pulls data from Dynamics CRM 5. The Data I am getting back is an IQueryable of type Account (The CRM Entity class auto generated by CrmSvcUtil). I am retrieving all of the items and can loop through them with code like this:
@foreach (var item in Model.ToList())
{
<tr>
<td>
@item.AccountId
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
</tr>
}
The problem is, I would like to instead put them in a drop down list. I can't figure out what the syntax is to put these in a DropDown is.
Any suggestions?