I had some code which in the razor file within a table set a dropdownlist using:
foreach (var item in group) {
<tr>
<td>
...
@Html.DropDownListFor(modelItem => item.OfficeUserId, Model.OfficeApprovers, new { @class = "officeapproverddl", invoiceLineId = @item.InvoiceLineId, officeUserId = @item.OfficeUserId })
...
</td>
</tr>
}
</table>
This worked well however now I want the same dropdown list outside the table. Hence there will be no item object to use.
How do you make this work outside the table ie. All I have to provide it now are Model.OfficeApprovers and the html attributes.
Model.OfficeApprovers is of type: new Dictionary<string, IEnumerable<SelectListItem>>();