路由配置

路由约束:正则表达式

constraints

 routes.MapRoute(
                name: "Default2",
                url: "gz-{controller}/{action}/{name}/{id}",
                defaults: new { controller = "Home", action = "HtmlHelper"},
                constraints: new { id="[0-9]+" }//路由约束

          namespaces: new string[1] { "S01Annotation.Controllers" }//去指定的命名空间查找方法
);

 

posted @ 2014-04-01 02:24  bl84757922  阅读(196)  评论(0编辑  收藏  举报