Questions tagged [asp.net-mvc-areas]

An organizational concept present in ASP.NET MVC, that allows the developer to partition a large web application into smaller units.

An organizational concept present in ASP.NET MVC, that allows the developer to partition a large web application into smaller, distinct units. Areas might be used to, for instance, divide an application into inventory, review, storefront, and administration modules.

More information

575 questions
26
votes
4 answers

Visual studio 2017 / 2019 add areas missing

While creating a ASP.NET MVC Core Web app using VS2017 / 2019, came across that 'Add Areas' option is missing from Context menu.
22
votes
3 answers

MVC3 When To Use Areas?

I am working on an agile MVC3 project and it is starting to get rather large, specifically my management section, where the user is able to set a lot of configurations, etc. This is my first MVC3 project, so I am just curious when it makes sense to…
shuniar
  • 2,592
  • 6
  • 31
  • 38
22
votes
1 answer

MVC call Html.Action within area?

I have an AREA called "Admin" It uses the same layout page as the rest of my site. In the layout page I have @Html.Action("MyMethod", "MyController", null) MyController is not in the Admin area but at the root/controllers folder when I go to any…
Daveo
  • 19,018
  • 10
  • 48
  • 71
22
votes
1 answer

How do you define a layout for specific areas in ASP.Net MVC 4?

I'm playing a little catch up here as I went straight from MVC2 to MVC4, so learning Razor and everything else all at once. I'm using an admin area in this new application, and I noticed when I went to the controller in the admin area it rendered…
Jhorra
  • 6,233
  • 21
  • 69
  • 123
20
votes
4 answers

ASP.NET MVC3 – Areas in Separate Assemblies

I am trying to set up an MVC3 solution using areas, but I want to have my areas in different assemblies. For example, I want a parent assembly that contains shared resources like master pages, style sheets, scripts, login page, etc. But I want…
SkipHarris
  • 2,334
  • 1
  • 25
  • 31
19
votes
4 answers

Can Areas in an ASP.NET MVC 2 application map to a subdomain?

Is there a way to map the Areas within an ASP.NET MVC 2 application to subdomains such as movies.example.com/Theater/View/2 instead of example.com/Movies/Theater/View/2 where { area = "Movies", controller = "Theater", action = "View", id = 2 }.
19
votes
2 answers

ASP.NET MVC4 List of all areas

I have an ASP.NET MVC4 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.
dev
  • 898
  • 1
  • 13
  • 33
18
votes
2 answers

ASP.NET MVC 4 Areas in separate projects not working (view not found)

I have tried to create simple proof-of-concept ASP.NET MVC 4 web site using areas in separate projects. I tried to following tutorials: http://bob.archer.net/content/aspnet-mvc3-areas-separate-projects (Application doesn't work in virtual…
Tomino
  • 5,969
  • 6
  • 38
  • 50
16
votes
1 answer

mvc5 attribute routing within area can't find view

When I'm inside Admin area and map my routes using attribute routing it cannot find view because it doesn't look inside actual area view folders but instead only global view folders. Only if I pass full path to view it then can display it, otherwise…
Stan
  • 25,744
  • 53
  • 164
  • 242
15
votes
5 answers

Relative Content Path in MVC3 Areas

I found this question Can't use relative paths with areas in ASP.NET MVC 2 which is the same issue I am having. Is this still the case in MVC3? Is there a way to keep content files in an area relative to the area? So that a layout file in an area…
Tony Basallo
  • 3,000
  • 2
  • 29
  • 47
15
votes
2 answers

ASP.NET Core RC2 Area not published

So I just updated my app to use ASP.NET Core RC2. I published it using Visual Studio and noticed that my Area is not published: This snapshot is from src\MyProject\bin\Release\PublishOutput: And here is my Area, named Admin in Visual Studio: Am I…
Vahid Amiri
  • 10,769
  • 13
  • 68
  • 113
15
votes
2 answers

ASP.NET MVC Areas: How to hide "Area" name in URL?

When running the MVC 2 Areas example that has a Blog Area and Blog Controller the URL looks like this: http://localhost:50526/Blog/Blog/ShowRecent in the format: RootUrl / AreaName / ControllerName / ActionName Having just discovered MVC Areas, it…
Mark Redman
  • 24,079
  • 20
  • 92
  • 147
14
votes
2 answers

MVC Areas for enterprise - good or bad?

Within a single project solution introducing Areas when you have a lot of controllers does improve separation and allows modules to easily be copied in or out of the solution. However in a large enterprise solution I would favour splitting the logic…
14
votes
8 answers

MVC Areas - View not found

I have a project that is using MVC areas. The area has the entire project in it while the main "Views/Controllers/Models" folders outside the Areas are empty barring a dispatch controller I have setup that routes default incoming requests to the…
user314827
  • 221
  • 1
  • 3
  • 8
14
votes
2 answers

How to specify default Area without adding area = "" to every ActionLink

I have a large existing application built on ASP.NET MVC2 RC2. All of my links look like this: htp//site/controller/action/id I just added an Area called: BigBird. Now when I'm in the BigBird area, all of my links look like this:…
iamwill
  • 163
  • 1
  • 6
1
2
3
38 39