0
@foreach (var item in Model) {
<tr>
    <td>            
        @Html.ActionLink(item.numberOfDocumentFiles.ToString(), "GetDocumentFiles","Documents", new { docId = item.documentId.ToString() } )            
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.saveDate)
    </td>
</tr>
}

I am assuming @Html.ActionLink to generate http://sitelink/Documents/GetDocumentFiles/6

but getting http://sitelink/Documents/GetDocumentFiles/?Length=9

What am i missing? Thank in advance for your help !

Sami
  • 3,686
  • 4
  • 17
  • 28
  • 1
    `@Html.ActionLink(item.numberOfDocumentFiles.ToString(), "GetDocumentFiles","Documents", new { docId = item.documentId }, null )` (add the last parameter - and you do not need `.ToString()` for the route value) –  Jul 18 '16 at 05:52
  • And the `?Length=9` is because there are 9 characters in "Documents" –  Jul 18 '16 at 05:54
  • @StephenMuecke, it worked :) ... wondering if you explain a bit about the last parameter "null" ... does it make the trick ? – Sami Jul 18 '16 at 05:58
  • 1
    You currently using [this overload](https://msdn.microsoft.com/en-us/library/system.web.mvc.html.linkextensions.actionlink(v=vs.118).aspx#M:System.Web.Mvc.Html.LinkExtensions.ActionLink%28System.Web.Mvc.HtmlHelper,System.String,System.String,System.Object,System.Object%29) where the 3rd parameter is the route values. The method serializes your object, which is a `string` and the only property of `string` is `Length` so `Length=9` is added to the `RouteValueDictionary` –  Jul 18 '16 at 06:00
  • Thank you Stephen , much appreciated – Sami Jul 18 '16 at 06:09

0 Answers0