ASP.NET MVC Routing Question

前端 未结 6 2053
悲哀的现实
悲哀的现实 2021-02-02 17:08

I must be dense. After asking several questions on StackOverflow, I am still at a loss when it comes to grasping the new routing engine provided with ASP.NET MVC. I think I\'v

6条回答
  •  礼貌的吻别
    2021-02-02 18:07

    OK I haven't ever properly tried this, but have you tried to extend the RouteBase class for dealing with users. The docs for RouteBase suggest that the method GetRouteData should return null if it doesn't match the current request. You could use this to check that the request matches one of the usernames you have.

    You can add a RouteBase subclass using:

      routes.Add(new UserRouteBase());
    

    When you register the routes.

    Might be worth investigating.

提交回复
热议问题