痛快-路由改写

在系统中会看到 Question/123 由来

改写路由

       public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Question_default",
                "Question/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Question_default1",
                "Question/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
原文地址:https://www.cnblogs.com/tongkuai/p/3350125.html