I want to specify the html id in ActionLink, but I can’t do this:
@html.ActionLink("Controller", "Action", new {@id = "tec"})
because the @id means that tec is a value of id parameter.
On the other hand, if I do
@html.ActionLink("Controller", "Action", new {@class = "tec"})
the result will be:
<a href="Controller/Action" class="tec"></a>
Do you know a way to specify the html id?
I wanna this result:
<a href="Controller/Action" id="tec"></a>
You have to specifiy also the controller and you can remove the
@before idThat’s because the signature you are using is not the one relative to HtmlAttributes, but to the routing values. If you do not want to specify the controller, use this