Jump to content

Ciclo if que redeciona views diferentes


Recommended Posts

Posted

Ola bom dia,

estou a tentar fazer um if deforma que dependendo do IAction selecionado me redirecione views diferentes 

<table>
    <tr>
        <td>
            <a href="~/professor/RegistarProfessor">  Registar como professor </a>
            @if(click == "Registar como professor")
            {
              <a asp-controller="Professor" asp-action="RegistarProfessor">
            }
        </td>
        <td>
            <a href="~/socios/RegistarSocio"> Registar como socio </a>
            @if (click == "Registar como socio")
            {
              <a asp-controller="Socio" asp-action="RegistarSocio">
            }
         </td>
    </tr>
</table>

Eu tentei fazer assim mas nao funciona, alguem tem ideias de como posso resolver isso ?

Posted
<table>
    <tr>
        <td>
            <a asp-controller="Professor" asp-action="RegistarProfessor" href="~/professor/RegistarProfessor">  Registar como professor </a>
            
              
        </td>
        <td>
            <a asp-controller="Socio" asp-action="RegistarSocio" href="~/socios/RegistarSocio"> Registar como socio </a>
           
        </td>
    </tr>
</table>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.