开发者

ASP.NET MVC3 List all areas

I have an ASP.NET MVC3 application in which I am creating multiple areas, is there a way I can find out programmatically the number of areas that are present and their names. What I want to do it create some partial pages in the different areas and in开发者_运维技巧 the main application create a page that will render the partial pages.


Is there a way I can find out programmatically the number of areas that are present and their names

No AFAIK currently there isn't an easy and reliable way to do this. In ASP.NET MVC 4.0 though there will be, I promise :-)

Currently you might need to use reflection and look at all namespaces containing Areas.something and count them. Not very reliable.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜