I have a link that calls a function JS (POPUP), in this popup I have a registration form, to validate all the parameters of my form, I need to obtain the ID of the My Model that is in the view of the Link I am not able to obtain this ID for insertion of data in BD
Take a look at my cod:
view:
<table>
<tr>
<th>Nome</th>
<th>Adicionar</th>
</tr>
@foreach (var c in Model.Contactados)
{
<tr>
<td>@Html.DisplayFor(cc => c.Nome)</td>
<td><a class ="chamar" href="#">Adicionar</a></td>
</tr>
}
form that should receive the ID of the previous view:
@using Forte.Rastreador.ViewModels
@model SuperViewModel
@using (Html.BeginForm("CadastrarContatoContactado", "Master", FormMethod.Post))
{
@Html.ValidationSummary(false)
<fieldset>
<legend></legend>
@Html.Label("Contato: ")
@Html.TextBoxFor(c=>c.DescricaoContatoContactado)
@Html.Label("Tipo Contato: ")
@Html.DropDownListFor(c => c.CodTipoContato, Model.TipoContatoList)
<input type="submit" value="Adicionar Contato" />
}