Whenever I run the program, I get this error:
Exception thrown
System.NullReferenceException: 'Object reference not set to an instance of an object.'
E_Shopping_System.Models.Customer.ShowallCustomer.get
returned null.
@foreach (var item in Model.ShowallCustomer)
This is the code
@foreach (var item in Model.ShowallCustomer)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Address)
</td>
<td>
@Html.DisplayFor(modelItem => item.Mobileno)
</td>
<td>
@Html.DisplayFor(modelItem => item.Birthdate)
</td>
<td>
@Html.DisplayFor(modelItem => item.EmailID)
</td>
<td>
@Html.ActionLink("Modify", "Edit", new { id = item.CustomerID }) |
@Html.ActionLink("Detail", "Details", new { id = item.CustomerID }) |
@*@Html.ActionLink("Remove", "Delete", new { id = item.CustomerID })*@
@Html.ActionLink("Remove", "Delete", new { id = item.CustomerID },
new { onclick = "return confirm('Are sure wants to delete?');" })
</td>
</tr>
}