痛快-路由改写

在系统中会看到 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 }
            );
        }

 

posted @ 2013-10-03 12:11  痛快  阅读(205)  评论(0编辑  收藏  举报