不是如何把.net MVC4.0 Areas里面的页面设置为默认页的可以看看。

 1 //Areas路由文件的修改方法        
 2 
 3 public override void RegisterArea(AreaRegistrationContext context)
 4         {
 5             Trace.WriteLine("Cosmetology");
 6         }
 7 
 8 //Global文件的修改方法,注册路由,完美呈现,针对部署IIS中的默认页问题。
 9 
10  public static void RegisterRoutes(RouteCollection routes)
11         {
12             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
13              routes.MapRoute(
14                 "Default", // Route name
15                 "{controller}/{action}/{id}", // URL with parameters
16                 new {controller = "Beautiful", action = "Index", id = UrlParameter.Optional } // Parameter defaults
17                 , new string[] { "JaredDemo.Areas.Cosmetology.Controllers" }
18                 ).DataTokens.Add("Area", "Cosmetology");
19 
20 
21 //找个解决方案怎么这么难还要去国外网站上看,谁能推荐一些帮助解决问题的网站,也不必要那么麻烦。不明白的朋友可以留言。
22         }

附上国外网站解决方案:http://www.philliphaydon.com/2011/07/mvc-areas-routes-order-of-routes-matter/

posted @ 2013-04-16 18:27  ω♪zone咕咯  阅读(1017)  评论(0编辑  收藏  举报