Url.Action map a wrong link from Route attribute

前端 未结 3 1975
情歌与酒
情歌与酒 2021-01-18 00:15

This is target controller and action:

[RoutePrefix(\"Editor\")]
public class EditorController : Controller

[HttpGet]
    [Route(\"{id:int}\")]
    public A         


        
3条回答
  •  隐瞒了意图╮
    2021-01-18 00:21

    Have you checked if you have enabled MVC AttributeRoutes?

    routes.MapMvcAttributeRoutes();
    

    see http://blogs.msdn.com/b/webdev/archive/2013/10/17/attribute-routing-in-asp-net-mvc-5.aspx

提交回复
热议问题