Doubt with parameter passing in an Url.Action

2

I have a control that gets an ID and makes a listing, but on this page I have a button to return to the previous page, then as it also gets an id, then how could I pass this id dynamically?

Here I am returning by passing ID 1: SelectModality / 1

<div class="span6">
    <a href="@Url.Action("SelecionarModalidade/1", "Modalidade" )" class="btn btn-lg btn-block btn-warning glyphicon glyphicon-hand-left">
    Retorno
    </a>
</div>

    
asked by anonymous 27.07.2016 / 05:38

1 answer

2

So:

<a href="@Url.Action("SelecionarModalidade", "Modalidade", new { id = 1 })" class="btn btn-lg btn-block btn-warning glyphicon glyphicon-hand-left">
    
27.07.2016 / 05:49