I'm VERY confused as to why this code
Html.ActionLink("About", "About", "Home", new { hidefocus = "hidefocus" })
results in this link:
<a hidefocus="hidefocus" href="/Home/About?Length=4">About</a>
The hidefocus
part is what I was aiming to achieve, but where does the ?Length=4
come from?
This will take the overload: string linkText, string actionName, string controllerName, Object routeValues, Object htmlAttributes
Perhaps others had the same issue and need to supply a class value via HTMLAttributes parm. Here's my solution:
With attribute names:
The way I solved this is was adding a null to the fourth parameter before the anonymous declaration (
new {}
) so that it uses the following method overload: (linkText, actionName, controllerName, routeValues, htmlAttributes):