Click here to Skip to main content
15,915,319 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HTML
<% foreach (var ModalLogin in Model)       // CS1579: foreach statement cannot operate on variables of type 'MVCLoginForm.Models.ModalLogin' because 'MVCLoginForm.Models.ModalLogin' does not contain a public definition for 'GetEnumerator'
   { %>
    <tr>
        <td>
            <%= Html.ActionLink("Record", "Record", ModalLogin)%>
        </td>
        <td>
            <%= Html.Encode(ModalLogin.Name)%>
        </td>
        <td>
            <%= Html.Encode(ModalLogin.Email)%>
        </td>
    </tr>
<% } %>
Posted

1 solution

what is the type of your model?

it should be IEnumerable or IQueryable.
 
Share this answer
 
Comments
harshil gandhi 18-Aug-15 2:12am    
Thank You ..@suket shah

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900