You can pass the parameters as htmlAttributes.
To do this, use the overload @Html.ActionLink("texto ancora", "Action", "Controller", new { htmlAtributtes })
Example:
@Html.ActionLink("Perguntas", "Index", "PerguntasRespondidas", new { @class="ui-btn ui-mini", data_rel="close", data_transition="flip", data_role="button" })
Remarks:
The word class
is a reserved word. So when you pass a css class like htmlAttribute use the syntax @class="sua-classe"
MVC will know how to render it in the View.
htmlAttributes is a object
for the compiler, so the name of its property cannot count some characters. such as the hyphen. Hence the attributes data-
html should be written as data_
. Again MVC does its part and renders as data-
Soon the above example would be rendered as:
<a class="ui-btn ui-mini" data-rel="close" data-role="button" data-transition="flip" href="/PerguntasRespondidas/Index/">Perguntas</a>
Example: https://dotnetfiddle.net/KWLSeF
I did it this way, it worked! <a href="/Questionsrespondidas" class="ui-btn ui-mini" data-rel="close" data-Transition="flip" data-role="button" >Completed Questions</a>
– Harry