Arthi Viji
Arthi Viji

Reputation: 13

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.

Upvotes: 1

Views: 807

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039160

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.

Upvotes: 1

Related Questions