Pass two parameters - ASP.NET CORE

1

I need to pass two parameters to a page, when I'm trying to pass one, I do it this way:

<a asp-page="/ContaReceber/Edit" asp-route-id="@item.Id;" class="btn btn-sm btn-success">Editar</a>

I tried to pass something like:

<a asp-page="/ContaReceber/Edit" asp-route-id="@item.Id; @item.PessoaId" class="btn btn-sm btn-success">Editar</a>

I tried to put only comma, name the parameter, but it does not work, how can I pass more than one parameter to the page.

    
asked by anonymous 05.07.2018 / 16:30

1 answer

3

Place% of the route parameter name, example :

<a asp-page="/ContaReceber/Edit" 
   asp-route-id="@item.Id" 
   asp-route-PessoaId="item.PessoaId" class="btn btn-sm btn-success">
Editar
</a>

Remember that each route parameter is separate and in the end you do not need to put asp-route- equal to the question. If you have more parameter just add as is in the example.

    
05.07.2018 / 16:34