开发者

How to use an Areas mechanism with asp.net MVC 1

开发者 https://www.devze.com 2022-12-26 15:45 出处:网络
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, FunctionalLo

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号