samedi 6 janvier 2018

Conditionally hide value in Razor

I have this simple Razor Page:

@model IEnumerable<Gestor.Models.PrecoExportacao>
<table class="table">
<tr>
    <th>
        @Html.DisplayNameFor(model => model.LinhaUn)
    </th>
    <th>
        @Html.DisplayNameFor(model => model.Descricao)
    </th>
    <th>
        @Html.DisplayNameFor(model => model.Apelido)
    </th>
    <th>
        @Html.DisplayNameFor(model => model.PesoLiquido)
    </th>
...
</tr>

If the value of model.PesoLiquido is 0 I want it not to be show, but keep the space in the table. How do I do?




Aucun commentaire:

Enregistrer un commentaire