im trying to highlight the rows where the paid date is expired or it has 30 days to be expired.
when i build this it says it ... does not contain Definition for the ".Days"
.
im new to this please help
@foreach (var item in Model)
{
int daysLeft = (item.MembershipType.PaidDate - DateTime.Today).Days;
string style = daysLeft <= 30 ? "background-color:Red" : null;
<tr style="@style">
<td>
@Html.DisplayFor(modelItem => item.SupplierName)
</td>
<td>
@Html.DisplayFor(modelItem => item.MembershipType.PaidDate)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
@Html.ActionLink("Details", "Details", new { id = item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id = item.Id })
</td>
</tr>
}