How to use an Areas mechanism with asp.net MVC 1
To use separation of concern and to optimize the clearness of the controllers we decided to split each action of a controller into different controllers (FunctionalLocationEditController
, FunctionalLocationCreateController
and such).
Problem now is the Globa开发者_开发百科l.asax is currently a bit big for just a few pages registered in routes.
We would need to use an area type of mechanism but for business reason we are not ready to upgrade just yet to MVC2.
Basically, is there a way in MVC1 to map the Urls to something like <folder>/<controller>/<action>
?
Yes. Check out Sharp Architecture (open source). They have a very nice Areas mechanism that works with ASP.NET MVC 1.
I would consider looking at portable areas in MVC contrib. You can have a look here :
http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx
精彩评论