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.

Url generator in view ignored Area Name when a another controller has AttributeRoute  #7046

Closed
@John0King

Description

@John0King

MVC version

AspNetCore MVC 2.0.0 on .net Framework 4.6.1

description

Areas/
    Admin/
        Controllers/
            [Area("Admin")]NewsController.Index  ---  with Route.MapRoute("{area:exists}/{controller=Home}/{action=Index}/{id?}")

Controllers/
    NewsController.Index  --with AttributeRoute [Route("News")]

when I inside Admin area with <a asp-action="Index" asp-controller="News">link</> , It generate /News for me,
and if I remove the attributeRoute or specific asp-area="Admin" it will generate the right url /Admin/News

I don't know why the ambient values are ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions