码迷,mamicode.com
首页 > Web开发 > 详细

asp.net mvc中配置路由默认值(Area中)

时间:2017-08-07 22:09:27      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:string   dex   bsp   register   color   res   url   log   collect   

  public class RouteConfig
    {
        private static string[] namespaces = new string[1] { "Best.Site.Areas.BestPalace" };
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.IgnoreRoute("ActiveReports.ReportService.asmx/{*pathInfo}");
            routes.IgnoreRoute("ActiveReportService.asmx/{*pathInfo}");
            routes.IgnoreRoute("{*allActiveReport}", new { allActiveReport = @".*\.ar10(/.*)?" });

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}"
                ,
                defaults: new { controller = "MenuAddress", action = "Index", id = UrlParameter.Optional },
                namespaces: namespaces
            ).DataTokens["area"] = "BestPalace";
        }
    }

 

asp.net mvc中配置路由默认值(Area中)

标签:string   dex   bsp   register   color   res   url   log   collect   

原文地址:http://www.cnblogs.com/gaocong/p/7301250.html

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