When you create a Controller
, you create one:
public ActionResult Index()
{
return View();
}
But in this Controller
, if you have a new Action
and a parameter is necessary, if the user tries to open this link it will generate an error. Is there any way to avoid this error when View is sending a parameter like this:
foreach (var item in Model)
{
<a href="/Relatorios/ListaSelecionado/@item.IDJOGOCAIXA" class="list-group-item">
Número : @Html.DisplayFor(c => item.IDJOGOCAIXA) -
</a>
}
public ActionResult ListaSelecionado(int id)
{
return View();
}
Error: