How to hide action method from url in ASP.Net Core.
I have a layout page and there is a link on it as below:
<a asp-area="Admin" asp-controller="Category" asp-action="Index">Category</a>
The link calls the following action method:
public IActionResult Index()
{
return View();
}
The problem is the URL and need to hide Area/Controller/Action Method. So I add the attribute
[Route("TestRoute")] to the top of the action method and so change the link as below:
<a href="~/TestRoute">Category</a>
I used href instead of tag helpers after using Route attribute to hide Area/ActionMethod in my URL, and I need to know if I can still/yet use tag helpers without showing Area/Controllers in my URL?
Or let me know if I am doing the right way?