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
2
votes
1 answer

MVC Routing Inside a Folder

I have built a standard MVC application with controllers and views and the following routes:- routes.MapRoute ( name: "PageNumber", url: "{controller}/{action}/page-{pageNumber}", defaults: new { controller = "Home", action = "PageNumber"…
Mike Upjohn
  • 1,251
  • 2
  • 16
  • 38
2
votes
1 answer

ASP.Net MVC 2 Area, SubArea and Routes

I have been looking around for a solution for my problem. Found alot of similar issues, but none of them led to a solution for me. I am trying to register an Area within an Area. This works however it "partially" screws up my routing. My route…
2
votes
2 answers

ASP.NET MVC: possible to move "Home" to area?

Anyone know if it's possible to move the HomeController and Home related views into the Areas directory? I'm trying to keep my root directory nice and clean and avoid having the ~/Views and ~/Controllers directories if I can. Furthermore, I can see…
Derek Hunziker
  • 12,996
  • 4
  • 57
  • 105
2
votes
2 answers

Web API 2 routing fails for literal segment

I'm facing an issue with Web API 2 routing for literal segments. In one project, I have ASP.NET MVC and WebAPI2 running together, the project is also running MVC areas. Under each area, there is API folder which contains APIs. I'm facing an issue…
2
votes
2 answers

Different controllers with the same name in two different areas results in a routing conflict

I have two areas: ControlPanel and Patients. Both have a controller called ProblemsController that are similar in name only. The desired results would be routes that yield /controlpanel/problems =>…
moribvndvs
  • 42,191
  • 11
  • 135
  • 149
2
votes
1 answer

Default Controller for an Area?

This is sort of a duplicate of Trouble setting a default controller in MVC 2 RC Area But his answer doesn't satisfy me, because it doesn't work. I have the…
Krisc
  • 1,357
  • 2
  • 14
  • 22
2
votes
1 answer

Organizing Areas in ASP.Net MVC 5

Get ready for yet another elementary question from me...I think I have a grasp on the Area concept in a MVC site, but I would like to organize them even further, could I either move them to an external project (with controllers, views, scripts,…
clockwiseq
  • 4,189
  • 9
  • 38
  • 61
2
votes
1 answer

How is other content besides views handled with PortableAreas from the MVCContrib library?

I have seen blog entries like ASP.Net MVC Portable Areas - Part 2 that indicate that the build action for views must be set to Embedded Resource. What about other content such as images and CSS? Should they be set to Embedded Resource as well? Will…
Matt Spradley
  • 7,854
  • 9
  • 31
  • 40
2
votes
0 answers

MVC Areas and Selective Deployment Strategies

A general deployment related question for a project that uses MVC Areas. We built a MVC project with areas and each area is a module in a bigger application. Each module can be considered as a separate sub-application with its own specific function.…
2
votes
2 answers

Why doesn't the compiler find my razor helpers in an Orchard theme?

I would like to share among views the logic for creating an img tag from a mediaPart. I have already created the following razor helper method: @helper CreateImgFromMediaPart(dynamic mediaPart, int width = 150) { var imgSrc = mediaPart != null…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
2
votes
1 answer

ASP.NET MVC4 application with nested areas

Previously I built an pluggable mvc4 app with a concept of areas in MVC4 as described in this article. I was facing problem in deploying this app and I solved it as described here. Now I want to go one step further. I want to use nested areas i.e.…
Saurabh Palatkar
  • 3,242
  • 9
  • 48
  • 107
2
votes
2 answers

Preflight request returns 404 Not Found for Controllers in an Area

I have a WebAPI project, and I have enabled CORS by following these steps: Get the nuget package: Install-Package Microsoft.AspNet.WebApi.Cors. Added config.EnableCors(); to WebApiConfig.cs. Added [EnableCors(origins: "*", headers: "*", methods:…
BG100
  • 4,481
  • 2
  • 37
  • 64
2
votes
1 answer

How can I know which Area my MVC controller action is being called in?

I want to know how, from a controller action, I could identify the area in which the controller is in via the MVC framework (I mean, without making all controllers in a given area inherit from a base controller with that info). I'm particularly…
kripto_ash
  • 919
  • 7
  • 14
2
votes
3 answers

Unable to find Area View in ASP.Net MVC 5

A new project is unable to find the views for a new Area. It is trying to find it in the parent Views folder. A suggested solution is to put .DataTokens.Add("area", "AREANAME") into the RegisterArea method. public override void…
Jonas Arcangel
  • 2,085
  • 11
  • 55
  • 85
2
votes
2 answers

Best practices for ASP.NET MVC areas

I'm currently building a CMS system, and I need to have an easy way include or exclude components. My first think was to use asp.net mvc area feature, to identified each component on itself. But from what I see, the area feature has problems, so…
Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96