This is an example of "overload hell" in ASP.NET MVC.
The first code calls the following method:
public static MvcHtmlString ActionLink(
this HtmlHelper htmlHelper,
string linkText,
string actionName,
string controllerName,
Object routeValues,
Object htmlAttributes
)
whereas the second code calls this one:
public static MvcHtmlString ActionLink(
this HtmlHelper htmlHelper,
string linkText,
string actionName,
Object routeValues,
Object htmlAttributes
)
Notice that the string parameter controllerName
in the first call is becoming routeValues
in the second one. The string value "Product" is being passed to the routed values: the string property Length
is used, which has a length of 7 here, hence the "Length=7" you're getting in the route.
Considering the first method, it seems that you've swapped the routeValues
and htmlAttributes
parameters.