help with basic MVC project
Posted
by Shrewd Demon
on Stack Overflow
See other posts from Stack Overflow
or by Shrewd Demon
Published on 2010-05-05T09:17:27Z
Indexed on
2010/05/05
9:28 UTC
Read the original article
Hit count: 227
hi,
i am creating a demo MVC project and i am getting a Null Object Reference error for the following code.
<% foreach (var item in Model) { %>
<tr>
<td>
<%= Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %> |
<%= Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ })%> |
<%= Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })%>
</td>
<td>
<%= Html.Encode(item.ContactEmail) %>
</td>
<td>
<%= Html.Encode(item.YourQuery) %>
</td>
</tr>
<% } %>
i get an error in the first line itself (var item in Model) coz i am getting the Model object as null.
Can anyone please help me.
thanks.
© Stack Overflow or respective owner