Hi, I'm new to using ASP.NET and I'm having trouble collecting the data:
In a view I show several elements in a table and in the last column there is a text box to be filled in by the user. The problem is that I don't know how to collect all the text strings of each of the forms in the Post controller. I would appreciate if someone could help me with this. Thanks in advance.
@if (Model.Habitaciones.Count == 0)
{
<tr><td colsapn="3">No hay habitaciones disponibles</td></tr>
}
else
{
foreach (Habitacion hab in Model.Habitaciones)
{
<tr>
<td>
@Html.DisplayFor(modelItem => hab.NHabitacion)
</td>
<td>
@Html.DisplayFor(modelItem => hab.Tipo.NombreTipo)
</td>
<td>
@Html.DisplayFor(modelItem => hab.Precio)
</td>
<td>
<input type="text" name="Coments" value="Observacion" class="w-50"/>
</td>
</tr>
}
}