2
I need to render one View into another, but this rendered View needs to receive and display data from the database, so I’m going to use @Html.Action for this, but I need to pass a parameter to the method in the controller to fetch the data in the database based on that parameter and to rederizate the View with the data. The problem is that the way I did the parameter is not passed, it is always null.
View:
@Html.Action("ExibirCliente", "Cliente", new {idcliente = Model.ID})
Controller:
[Authorize]
public ActionResult ExibirCliente(int idcidade)
{
Cliente c = new Cliente();
c = c.BuscarCliente(idcidade);
return PartialView("~/Views/Shared/_ViewCLiente.cshtml", cep);
}
Thank you guys, I knew that the names had to be the same, but I passed the code step by step and did not see the name different from the variable.... What a blunder Thank you Rsrs, now obviating worked...
– Alan Almeida