Hello
I have a loop creating a form in my view code. Within the form each item has its own drop down list which they all share from the view data:
<%foreach(Foo i in Model){ %>
<tr>
<td><%=i.title%></td>
<td><%=Html.DropDownList("order"+i.id.ToString(), ViewData["SequenceDropDown"] as SelectList)%></td>
</tr>
<%} %>
I need to make it so the selected item is based on a property of Foo (i.Sequence). I cant seem to find a way to do this?
I can do it in the controller, but I want to be able to share the select list amongst all the items and pick the selected one accordingly.