码迷,mamicode.com
首页 > 其他好文 > 详细

路由学习2

时间:2016-09-27 11:30:27      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

public class RouteConfig
{
    /// <summary>
    /// RegisterRoutes
    /// </summary>
    /// <param name="routes">routes</param>
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.MapRoute(
            name: "cdnStyle",
            url: "style/{appVersion}/{appChannel}/{appOs}/{applicablePeople}/{resourceVersion}/{pageCode}.js",
            defaults: new { controller = "App", action = "Style" });

        routes.MapRoute(
            name: "project",
            url: "project/{appVersion}/{appChannel}/{appOs}/{pageCode}.js",
            defaults: new { controller = "App", action = "GetProjects" });

        routes.MapRoute(
            name: "Version",
            url: "App/Version",
            defaults: new { controller = "App", action = "Version", id = UrlParameter.Optional });
    }
}

其他所有路径都会返回404

路由学习2

标签:

原文地址:http://www.cnblogs.com/zhshlimi/p/5911922.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!