I need to enable click on the row of table to reconnect to customer edit view , I need customer id. @*@Html.ActionLink("Edit", "Edit", new { id=customer.CustomerId })
Customer View List:
<table>
<thead>
<tr>
<th>Name</th>
<th>Surname</th>
</tr>
</thead>
<tbody>
@foreach (var customer in Model.Customers)
{
<tr>
<td>@customer.Name</td>
<td>@customer.Surname</td>
</tr>
}
</tbody>
</table>
you can add the attribute onclick
on your tr tag like this :
<tr onclick="location.href = '@Html.ActionLink("Edit", "Edit", new { id=customer.CustomerId }))'">
<td>@customer.Name</td>
<td>@customer.Surname</td>
</tr>