ASP.NET MVC Default route?

前端 未结 4 2022
眼角桃花
眼角桃花 2020-12-09 16:49

I created a new ASP.NET MVC project and implemented a site authorization filter.

When I map the routes to the {controller}/{action} pair, I pass a role

4条回答
  •  无人及你
    2020-12-09 17:15

    Make sure the Default route is at the BOTTOM of your listed route table. Order matters when it comes to ASP.NET MVC Routing tables.

    The correct ordering is your 'most specific' route to your least specific route.

提交回复
热议问题