I'm having trouble calling ActionResult using input type="submit"
and passing the model data.
I did a test using ActionLink
but the Model is not sent.
Could someone give a light?
Follow the code: Controller:
[HttpPost]
public ActionResult Aprovar(FormularioModel model)
{
//Código
}
[HttpPost]
public ActionResult Devolver(FormularioModel model)
{
//Código
}
View:
@using (Html.BeginForm(null, "Domiciliacao", FormMethod.Post, new { id = "formFila" }))
{
@Html.Partial("~/Views/Shared/ViewPartial.cshtml", Model) //PartialView sendo carregada para complentar os dados da tela.
//Código
<div>
<input type="submit" value="Aprovar" name="Aprovar" formmethod ="post" formaction="~/Domiciliacao/Aprovar" class="btn btn-success btn-lg"/>
</div>
<div>
<input type="submit" value="Devolver" name="Devolver" formmethod ="post" formaction="~/Domiciliacao/Devolver" class="btn btn-danger btn-lg"/>
</div>
}