ASP.NET MVC中Area的另一种用法

一、在web项目中新建Areas文件夹,在其文件下创建FlowManage文件夹,在其下创建Controllers文件夹。然后在Areas文件夹中创建AreaRegistration的子类用于注册Areas路由,在Controllers文件夹中创建所需的Controller。
 1    public class FlowManageAreaRegistration : AreaRegistration 
 2     {
 3         public override string AreaName 
 4         {
 5             get 
 6             {
 7                 return "FlowManage";
 8             }
 9         }
10 
11         public override void RegisterArea(AreaRegistrationContext context) 
12         {
13             context.MapRoute(
14                 "FlowManage_default",
15                 "FlowManage/{controller}/{action}/{id}",
16                 new { action = "Index", id = UrlParameter.Optional }
17             );
18         }
19     }

 

posted @ 2017-04-05 14:37  装饰的梦  阅读(161)  评论(0)    收藏  举报