首页 > 代码库 > c# mvc 路由规则学习片段

c# mvc 路由规则学习片段

1、初步接触mvc 路由

routes.MapRoute(
               "CM",
               "CM/{controller}/{action}/{id}/",
               new { controller = "Home", action = "Index", id = UrlParameter.Optional }
           );

匹配: http://www.example.com/CM/{controller}/{action}/{id}

c# mvc 路由规则学习片段