Error:
Object reference not set to an instance of an object.
How to Solve.
Foreach line error display.
<table>
<tr>
<th>
<%: Html.DisplayNameFor(model => model.Emp_Name) %>
</th>
<th>
<%: Html.DisplayNameFor(model => model.Emp_Alies) %>
</th>
<th></th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td>
<%: Html.DisplayFor(modelItem => item.Emp_Name) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.Emp_Alies) %>
</td>
<td>
<%: Html.ActionLink("Edit", "Edit", new { id=item.Emp_Id }) %> |
<%: Html.ActionLink("Details", "Details", new { id=item.Emp_Id }) %> |
<%: Html.ActionLink("Delete", "Delete", new { id=item.Emp_Id }) %>
</td>
</tr>
<% } %>
</table>