@Url.Action showing unnecessary parameter value after rendering page in MVC

41 Views Asked by At

Why @Url.Action generates browser's URL on a tag? My local browser URL is http://localhost:26377/Users/details/1

I want to remove unnecessary parameter which is autogenerated from @Url.Action. My code is

<a href="@Url.Action("details", "Users")" class="btn btn-light  add-new">Add</a>

and after rendering page it shows

<a href="/Users/details/1" class="btn btn-light  add-new">Add</a>

Expected result:

<a href="/Users/details" class="btn btn-light  add-new">Add</a>
0

There are 0 best solutions below