I need to create an Insert from multiple fields at the same time! My system has multiple table and relationships and I am having difficulties at that point. I have this registration screen: Withthiscode:
@using(Html.BeginForm()){<divstyle="width: 100%; float: left;">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th style="width:200px; text-align:center; vertical-align:middle;">Alunos</th>
<th style="width:150px; text-align:center; vertical-align:middle;">Atribuir Nota</th>
</tr>
</thead>
<tbody>
@{
for (int i = 0; i < Model.ListaMatriculas.Count(); i++)
{
<tr>
<td>@Model.ListaMatriculas[i].Aluno.Nome</td>
<td style="text-align:center;">
<input type="hidden" name="Matricula.IdMatricula" value="@Model.ListaMatriculas[i].IdMatricula" />
<input type="text" name="Nota" value="0" style="width: 30px;" />
@Html.DropDownList("UnidadeCurricular.IdUnidadeCurricular", ViewBag.unidadecurricular_idunidadecurricular as SelectList, "")
</td>
</tr>
}
}
</tbody>
</table>
<div class="alert alert-success">
<b>Obs: Notas devem possuir valores de 0 a 100.</b>
</div>
</div>
<div style="width: 100%;">
<button class="btn btn-sucsess " type="submit">Salvar</button>
</div>
}
However when I click on the send my controller does not receive the values of the fields, someone can give me a Help, how can I do something like this? An example link or something like this ...