0
I need to pass parameter "01" of http://localhost:5934/Gestaodeservicos/Catalogo/Cadastro/01, to another controller.
namespace Intranet.Presentation.Areas.GestaoDeServicos.Controllers
{
public class ServicoController : Controller {
public ActionResult Cadastro(int id)
{
return this.View(id);
}
}
}
I want my route set to return to next: http://localhost:5934/Gestaodeservicos/Servico/Cadastro/01/00
Where parameter "01" is the id that came from the Catalogo controller and parameter "00" is nothing more than a new "Service".
You can add
[Route("Cadastro/{id}/{num}")]
to his action– Ricardo Pontual
You can do as @Ricardopunctual indicated, but I have a question... Why do you want to do this?
– Leandro Angelo
@Brunosouza, can explain your scenario better?
– Leandro Angelo
@Leandroangelo I did as suggested. It is a linear navigation. Whenever I access an "Id child", I need to pass via Controller the "Id Father". As I will have 5 levels, in the fifth and final, I will have to pass the 4 parameters.
– Bruno Souza