Try the following modification :
Controller use [Route("Test/{id}/{name}")] above the 'get' request of Details action
[Route("Test/{id}/{name}")]
public async Task<IActionResult> Details(int? id ,string name)
{
if (id == null)
{
return NotFound();
}
var test = await _context.TestTab
.FirstOrDefaultAsync(m => m.Id == id);
if (test == null)
{
return NotFound();
}
return View(test);
}
Index View use asp-route-{parameter} to pass the id and name
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Bedget)
</td>
<td>
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-action="Details" asp-route-id="@item.Id" asp-route-name="@item.Name">Details</a> |
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}