我正在开发一个 MVC 3 Web 应用程序,我想创建这样的东西:
/Controller
/Blog
BogController.cs
ViewsController.cs
ArticlesController.cs
/Customers
SalesController.cs
ProductsController.cs
HomeController.cs
/Views
/Blog
Index.aspx
Summary.aspx
/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
在控制器中创建子文件夹 https://stackoverflow.com/questions/1748960/asp-net-mvc-create-sub-folders-in-the-controller
但在他们回答这个人的解决方案中,MVC 2 和 MVC 3 中的 MapAreas 属性不存在(或者至少在我看来不存在)
那么我可以做什么来构建像 /Admin/Users/EditUser?id=2 这样的结构呢?
如果我需要创建路由规则,您能给我写一个如何执行此操作的示例吗?
考虑使用MVC3 领域 http://msdn.microsoft.com/en-us/library/ee671793%28v=vs.98%29.aspx。您可以为此创建一个管理区域。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)