asp-action and asp-controller not resolving route with attribute routing. #19927
Labels
affected-most
This issue impacts most of the customers
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-routing
severity-minor
This label is used by an internal tool
Milestone
I am working on a multi-tenant application in which I am using routing like this
endpoints.MapControllerRoute( name: "default", pattern: "{tenant}/{controller=Home}/{action=Index}/{id?}");
I have an action in which I am applying attribute routing.
public class DefaultController : Controller { [Route("{tenant}/asdf")] public IActionResult Index() { return Content("asdf"); } }
The issue is that when I creating a action link in a Razor view using tags
<a asp-action="Index" asp-controller="Default">asdf</a>
It is generating the wrong output
<a href="/a1/Default">asdf</a>
But it should generate
<a href="/a1/asdf">asdf</a>
The text was updated successfully, but these errors were encountered: