Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Taghelpers not resolving when accessing an action with a route attribute #4658

@EricJFisher

Description

@EricJFisher

I'm seeing add results.

I have a layout page with the following navigation

<ul>
    <li><a asp-controller="Character" asp-action="Index">Characters</a></li>
    <li><a asp-controller="Equipment" asp-action="Index">Equipment</a></li>
</ul>

From most of the application this navigation works properly resolving to...

<ul>
    <li><a href="/Character">Characters</a></li>
    <li><a href="/Equipment">Equipment</a></li>
</ul>

In my CharacterController though I have a Route Attribute on one of my actions...

[HttpGet]
[Route("[controller]/{name}/Details")]
public IActionResult Details(string name) { ... }

I am able to access this action properly through the custom route I've added to it, but when I do the navigation from my layout page resolves to...

<ul>
    <li><a href="">Characters</a></li>
    <li><a href="">Equipment</a></li>
</ul>

Causing navigation to no longer work, until I type in the URL manually, it only breaks when visiting the page with this route attribute, and removing the route attribute causes the tag helpers to resolve properly again. To me this is unexpected as I would expect the tag helpers to continue to resolve despite the route used to access a view. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions