Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create area in MVC project

In an MVC4 web application, what is the best way to create an Area? Can it be automated or is it a manual process of creating the controller, View folder etc?

like image 822
amateur Avatar asked Dec 08 '12 17:12

amateur


People also ask

How can add area folder in MVC?

To add an area to an MVC application, right-click on the project item with in the Solution Explorer window and select Add>Area option as shown below. Now a new prompt will appear, with in give the name of the area like "Department" and click Add button.

Why We Use Area in MVC?

Areas allows you to separate your modules and organize Model, View, Controller, Web. config and Routing registration file into separate sections. In live MVC Project implementation we can use Areas concept for organizing project in better manageable way. Area separate logical section like Model, View, Controller, Web.

How can register area in ASP.NET MVC?

In the application startup code, you can call AreaRegistration. RegisterAllAreas() to register all areas. This needs a routing cs file for each area as described in the preceding article. Once registered, all the areas will start showing up in the Routing Table.

What is MVC core area?

An area is effectively a structure inside an app. In an ASP.NET Core web project, logical components like Pages, Model, Controller, and View are kept in different folders. The ASP.NET Core runtime uses naming conventions to create the relationship between these components.


1 Answers

Right click on the ASP.NET MVC project in the solution explorer and select Add Area... in the contextual menu. Then type the name of the area and proceed:

enter image description here

like image 167
Darin Dimitrov Avatar answered Oct 14 '22 00:10

Darin Dimitrov