Button / link within a view redirecting to another view

1

I have the following address of a view :

http://localhost/Configuracao/Details/1

Where to create a button / link that redirects to another address of another view as follows:

<a href="@Url.Action("~/Views/Ativos/Index", Model.Id)" title="Visualizar" class="btn btn-info">
     <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
      Ativos 
</a>

Only by clicking on the address is:

http://localhost/Configuracao/~/Views/Ativos/Index

How to do this targeting?

    
asked by anonymous 20.02.2015 / 19:20

2 answers

5

You can call the View Index directly from the Active Controller:

 <a href="@Url.Action("Index", "Ativos", Model.Id)" title="Cancelar" class="btn btn-info">
         <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
          Ativos 
    </a>
    
20.02.2015 / 19:43
3

You do not need to use @Url.Action :

<a href="/Ativos/Index/@Model.Id" title="Cancelar" class="btn btn-info">
     <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
      Ativos 
</a>
    
20.02.2015 / 19:41