I am trying to remove parameters from URL to make user friendly URL and to optimize URL for Search Engine optimization.
I have written below code in startup.cs
routes.MapRoute(
name: "edit-project-route",
template: "manage-your-project/{id?}",
defaults: new { controller = "Manager", action = "EditProject"
});
Edit Button is there in detail page as shown below:
Here is code of above page:
@foreach (var item in Model)
{
count = count + 1;
<tr>
<td scope="row">@count</td>
<td>@Html.DisplayFor(modelItem => item.Name)</td>
<td>@Html.DisplayFor(modelItem => item.Technology)</td>
<td>
<a href="/manage-your-project/@item.ProjectId" class="btn btn-sm btn-primary">Edit</a>
<a href="@Url.Action("DeleteProject",new { id=item.ProjectId})" class="btn btn-sm btn-danger">Delete</a>
</td>
</tr>
}
Whenever I click on edit button, Below page is displayed in browser.
I want to remove highlighted ID from query string. Is there any way to achieve this by not affecting functionalities.