Does anyone have any idea why the code below doesn't give me any value but instead gives me "System.Web.Mvc.SelectListItem"?
If I don't do a foreach
but instead substitute the ViewData
with this
<%= Html.DropDownList("PersonOnCallCheckBoxList") %>
, I get the correct value. Please help.
foreach (var person in ViewData["Person"] as IEnumerable)
{
%>
<input type="checkbox" value="<%= person %>" /><%= person %><br />
<%
}