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.

RC2 : Mixing area inside anchor tag helper generates wrong url #4815

@marcusien

Description

@marcusien

In my _Layout.cshtml, I have built in link who redirects to the homepage (Home/Index)
<a asp-controller="Home" asp-action="Index">WebApplication1</a>
Inside the same layout.cshtml i put another anchor which redirects to an area controller (AreaTest/Test/Index).
<a **asp-area="AreaTest"** asp-controller="Test" asp-action="Index">Go to area</a>

When the page is loaded inside the browser, both of links are ok
-Home/Index
-AreaTest/Test/Index

If I click on the second link, I'm well redirected to the right page but if i look at the new links generated, the first one which was Home/Index at the first time is became AreaTest/Home/Index.

I joined a little sample

It could be nice to make the tag helpers safe and independent from each other

Note that the workaround is to explicitly fill asp-area attribute on the first anchor with empty value but it's a little bit tricky !
<a asp-area="" asp-controller="Home" asp-action="Index">WebApplication1</a>

WebApplication1.zip

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