I am trying to use an @Html.ActionLink
for a clickable link in my view, however I get a run time exception:
System.ArgumentException: 'Value cannot be null or empty. Parameter name: linkText
The first param of Html.ActionLink
is linkText
, and as you can see from my code below, it is indeed not null or empty.
@foreach (var o in Model.Results)
{
<tr>
<td>@Html.ActionLink(o.Person.FirstName, "Detail", "Player", new { selectedPlayerID = o.Person.IDPerson, referringController = "ValidationHistory" }, null)</td>
<td>@o.Person.FirstName</td>
<td>@o.Person.LastName</td>
<td>@o.Person.SocialSecurityNumber</td>
Below is a screen shot of the page, at the top I embedded a @(string.IsNullOrWhiteSpace(o.Person.FirstName) ? "null/ws": o.Person.FirstName) as you can see, it is indeed not null or empty.
Per request, below is the entire portion of the cshtml file that pertains to this issue.
<div class="col-md-10 text-center">
@if (Model.Results.Count == 0)
{
<h3>No Data to Display</h3>
<h3>Please Try Different Search Parameters</h3>
}
else
{
<div id="tablecontaner" class="col-md-10 text-left">
<table id="PVSearchReport" class="table table-striped table-bordered" style="width:100%;padding:10px">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>SSN</th>
<th>IRS / TIN</th>
<th>DMF Details</th>
<th>List Matches</th>
<th>Executed At</th>
<th>Executed By</th>
<th>Club ID</th>
<th>Lists</th>
</tr>
</thead>
<tbody>
@foreach (var o in Model.Results)
{
<tr>
<td>@Html.ActionLink(o.Person.FirstName, "Detail", "Player", new { selectedPlayerID = o.Person.IDPerson, referringController = "ValidationHistory" }, null)</td>
<td>@o.Person.FirstName</td>
<td>@o.Person.LastName</td>
<td>@o.Person.SocialSecurityNumber</td>
<td>@o.Validation_Results.IRSOk</td><!--IRS/TIN-->
<td>@o.Validation_Results.DMFOk</td><!--DMF Details-->
<td>@o.Validation_Results.ListOk</td><!--List Matches-->
<td>@o.Validation_Results.ExecutedAt<!--Executed At-->
<td>@o.Validation_Results.ExecutedBy</td><!--Executed By-->
<td>@o.Person.ClubID</td>
<td>@o.ListMatches</td>
</tr>
}
</tbody>
</table>
</div>
}
</div>