我只需要將列換成超鏈接。以便用戶可以單擊Number Column項目並可以重定向。 這裏是我目前的觀點: -如何用@ Html.ActionLink包裝@ Html.DisplayFor()
@foreach (var item in Model) {
<tr>
<th>
@Html.ActionLink("Read", "Read", new { id = item.id})
</th>
<td>
@Html.DisplayFor(modelItem => item.Number)
</td>
</tr>
試圖做這樣的事情。我知道它不對,但需要知道正確的做法。我是新來的MVC
@Html.ActionLink(@Html.DisplayFor(modelItem => item.Number).ToString(), "Read", new { id = item.id })