I am working on a razor view on MVC5, and I can not make it appear that I do not see the details that I leave null when I register.
Example in the image I have several questions but others were left empty because they were not necessary as I can do so that these empty fields do not appear to me.
driver.
public async Task<ActionResult> Details(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Formularios formularios = await db.Formularios.FindAsync(id);
if (formularios == null)
{
return HttpNotFound();
}
return View(formularios);
}
In the view I have a table that shows me the questions:
<table class="table table-hover table-responsive" style="width:100%">
<thead>
<tr>
<th>
Numero
</th>
<th>
Descripcion de Pregunta.
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Pregunta 1
</td>
<th>
@Html.DisplayFor(model => model.P1)
</th>
</tr>