我怎么能做到在ASP.NET MVC 1,取子文件夹。例如,采取控制器上下面的文件夹结构:
/控制器
/博客
ViewsController.cs
ArticlesController.cs
/客户
SalesController.cs
ProductsController.cs
HomeController.cs
我想有鉴于以下文件夹结构,每个视图发现控制器:
/浏览次数
/博客
/浏览次数
的Index.aspx
Admin.aspx
Show.aspx
/文章
Show.aspx
Admin.aspx
/客户
/销售
的Index.aspx
Totals.aspx
/产品
的Index.aspx
Promotions.aspx
/家
的Index.aspx
解决方案
您可以使用路由做到这一点,即
routes.MapAreaRoute(博客,
博客/浏览/ {控制器} / {行动} / {ID},
新{控制器=意见,行动=索引,ID =});
这似乎能满足您的需求上面给出的数据。
How can I do in ASP.NET MVC 1, to take sub folders. For example, taking the following folder structure on the controller:
/Controller
/Blog
ViewsController.cs
ArticlesController.cs
/Customers
SalesController.cs
ProductsController.cs
HomeController.cs
I would like to have the following folder structure in view, each view found your controller:
/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
解决方案
You could do it using Routes, i.e.
routes.MapAreaRoute("Blogs",
"Blog/Views/{controller}/{action}/{id}",
new { controller = "Views", action = "Index", id = "" });
That would seem to meet your needs given the data above.
上一篇:根据Athena查询结果创建CloudWatch指标查询结果、根据、指标、Athena
下一篇:我应该使用雅典娜视图为QuickSight进行连接,还是应该在QuickSight中进行连接?雅典娜、视图、QuickSight