User-1104215994 posted
Hi,
I would like to show/hide RequestDateTime according to <g class="gr_ gr_52 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="52" data-gr-id="52">null</g> value. I tried to add if but I got model does not
exist. How can I accomplish it?
@if(model.RequestDateTime!=null
@model IEnumerable<GameMonitor.Models.GameBanks>
@{
ViewData["Title"] = "Index";
}
<h2>Games</h2>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.ProductCode)
</th>
<th>
@Html.DisplayNameFor(model => model.Quantity)
</th>
<th>
@Html.DisplayNameFor(model => model.RequestDateTime)
</th>
<th>
@Html.DisplayNameFor(model => model.Used)
</th>
<th>
@Html.DisplayNameFor(model => model.ProductDescription)
</th>
<th>
@Html.DisplayNameFor(model => model.UnitPrice)
</th>
<th>
@Html.DisplayNameFor(model => model.Status)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.ProductCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.Quantity)
</td>
<td>
@Html.DisplayFor(modelItem => item.RequestDateTime)
</td>
<td>
@Html.DisplayFor(modelItem => item.Used)
</td>
<td>
@Html.DisplayFor(modelItem => item.ProductDescription)
</td>
<td>
@Html.DisplayFor(modelItem => item.UnitPrice)
</td>
<td>
@Html.DisplayFor(modelItem => item.Status)
</td>
<td>
<a asp-action="Details" asp-route-id="@item.GameBankId">Details</a>
</td>
</tr>
}
</tbody>
</table>