Apply the same class to several ActionLink elements in MVC C #

1

I need to apply the same class to many ActionLink elements to give it styles. At the moment I have this code:

@Html.ActionLink("Panel de Administrador", "Registro", "Registro", new { @class = "enlace" })
@Html.ActionLink("Cargar Casa", "Create", new {@class = "enlace" })

But when applying styles, only my first ActionLink takes me.

    
asked by Lucas. D 27.06.2016 в 05:04
source

1 answer

1

I already solved it, for some reason my 2nd ActionLink expected to have 4 parameters just like my first, so the code now I have it like this:

@Html.ActionLink("Panel de Administrador", "Registro", "Registro", new { @class = "enlace" })
@Html.ActionLink("Cargar Casa", "Create", "Home", new {@class = "enlace" })

And it works perfectly.

    
answered by 27.06.2016 в 05:48