我如何在ASP.NET MVC 1中执行子文件夹.例如,在控制器上采取以下文件夹结构:
/Controller /Blog ViewsController.cs ArticlesController.cs /Customers SalesController.cs ProductsController.cs HomeController.cs
我想要看到以下文件夹结构,每个视图找到你的控制器:
/Views /Blog /Views Index.aspx Admin.aspx Show.aspx /Articles Show.aspx Admin.aspx /Customers /Sales Index.aspx Totals.aspx /Products Index.aspx Promotions.aspx /Home Index.aspx
解决方法
你可以使用路线,即
routes.MapAreaRoute("Blogs","Blog/Views/{controller}/{action}/{id}",new { controller = "Views",action = "Index",id = "" });
鉴于上述数据,这似乎可以满足您的需求.